Starspace¶
This agent contains a simple implementation of the starspace algorithm, slightly adapted for dialogue. To learn more about the starspace algorithm, see this paper.
Basic Examples¶
Train a starspace model on the “sentence SQuAD” task.
parlai train_model --task squad:sentence --model starspace -lr 0.01 -esz 512 -k 10 -mf /tmp/starspacesquad
DictionaryAgent Options¶
BPEHelper Arguments
Argument |
Description |
---|---|
|
Path to pre-trained tokenizer vocab |
|
Path to pre-trained tokenizer merge |
|
Use BPE dropout during training. |
StarspaceAgent Options¶
StarSpace Arguments
Argument |
Description |
---|---|
|
Choose between different strategies for initializing word embeddings. Default is random, but can also preinitialize from Glove or Fasttext. Preinitialized embeddings can also be fixed so they are not updated during training. |
|
Size of the token embeddings |
|
Max norm of word embeddings |
|
Whether LHS and RHS share embeddings |
|
If set to 1, add a linear layer between lhs and rhs. |
|
Learning rate |
|
Margin |
|
Fraction of input/output features to dropout during training |
|
Choose between pytorch optimizers. Any member of torch.optim is valid and will be used with default params except learning rate (as specified by -lr). |
|
Truncate input & output lengths to speed up training (may reduce accuracy). This fixes all input and output to have a maximum length. |
|
Number k of negative samples per example |
|
Include query as a negative |
|
Use frequency based normalization for embeddings. |
|
Size of negative sample cache to draw from |
|
Number of past tokens to remember. |
|
Keep replies in the history, or not. |
|
File of cands to use for prediction |
BPEHelper Arguments
Argument |
Description |
---|---|
|
Path to pre-trained tokenizer vocab |
|
Path to pre-trained tokenizer merge |
|
Use BPE dropout during training. |