This is the code accompanying the arxiv preprint Discovering the compositional structure of vector representations with Role Learning Networks.
For the complete architecture, see RoleLearningTensorProductEncoder. If you are interested in the role learning module depicted in Figure 1, see RoleAssignmentLSTM.
To train a ROLE model, you want to use decompose.py
. You need to place your training files
in the data/ directory (see the example files there). Then you run:
python decompose.py --data_prefix example --num_roles NUM_ROLES --filler_dim FILLER_DIM --role_dim ROLE_DIM --role_learning