Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

[Poly-encoder] Fixes for DSTC7 Task #2314

Merged
merged 3 commits into from
Jan 6, 2020

Conversation

klshuster
Copy link
Contributor

Patch description
The DSTC7 Augmented Sampled teacher was using a different train set than the one we used in the Poly-encoder paper; this PR fixes that.

Also a small fix to use the data in shared.

Fix for #2306

Testing steps
I trained a poly-encoder model and got similar results to those in the paper.

Logs

$ python examples/train_model.py -m transformer/poly_encoder -t dstc7:UbuntuDSTC7TeacherAugmentedSampled --init-model zoo:pretrained_transformers/poly_model_huge_reddit/model  --batchsize 256   --model transformer/polyencoder  --warmup_updates 100  --lr-scheduler-patience 0  --lr-scheduler-decay 0.4  -lr 5e-05  --data-parallel True  --history-size 20  --label-truncate 72  --text-truncate 360  -vp 5  -veps 0.5  --validation-metric accuracy  --validation-metric-mode max  --save-after-valid True  --log_every_n_secs 20  --candidates batch  --dict-tokenizer bpe   --dict-lower True  --optimizer adamax  --output-scaling 0.06  --variant xlm  --reduction_type mean  --share-encoders False  --learn-positional-embeddings True  --n-layers 12  --n-heads 12  --ffn-size 3072  --attention-dropout 0.1  --relu-dropout 0.0  --dropout 0.1  --n-positions 1024  --embedding-size 768  --activation gelu  --embeddings-scale False  --n-segments 2  --learn-embeddings True  --share-word-embeddings False  --dict-endtoken __start__  --fp16 True  --polyencoder-type codes  --codes-attention-type basic  --poly-n-codes 64  --poly-attention-type basic  --polyencoder-attention-keys context --eval-batchsize 10 --model-file /tmp/test_model --dict-file data/models/pretrained_transformers/poly_model_huge_reddit/model.dict

.
.
.
[creating task(s): dstc7:DSTC7TeacherAugmentedSampled]
[ running eval: valid ]
[ eval completed in 282.11s ]
valid:{'exs': 5000, 'accuracy': 0.6068, 'f1': 0.6216, 'hits@1': 0.607, 'hits@5': 0.81, 'hits@10': 0.883, 'hits@100': 1.0, 'bleu-4': 0.5299, 'lr': 2e-05, 'total_train_updates': 3537, 'gpu_mem_percent': 0.419, 'examples': 5000, 'loss': 9024.0, 'mean_loss': 1.805, 'mean_rank': 5.001, 'mrr': 0.6998}
[creating task(s): dstc7:DSTC7TeacherAugmentedSampled]
[ running eval: test ]
[ eval completed in 56.18s ]
test:{'exs': 1000, 'accuracy': 0.696, 'f1': 0.7125, 'hits@1': 0.696, 'hits@5': 0.864, 'hits@10': 0.905, 'hits@100': 1.0, 'bleu-4': 0.666, 'lr': 2e-05, 'total_train_updates': 3537, 'gpu_mem_percent': 0.419, 'examples': 1000, 'loss': 1358.0, 'mean_loss': 1.358, 'mean_rank': 3.936, 'mrr': 0.7736}

@codecov
Copy link

codecov bot commented Jan 3, 2020

Codecov Report

Merging #2314 into master will decrease coverage by 7.28%.
The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2314      +/-   ##
==========================================
- Coverage   30.64%   23.35%   -7.29%     
==========================================
  Files         595      578      -17     
  Lines       62959    62529     -430     
  Branches    10070    10023      -47     
==========================================
- Hits        19296    14606    -4690     
- Misses      42262    46984    +4722     
+ Partials     1401      939     -462
Flag Coverage Δ
#mturk_tests 8.53% <0%> (ø) ⬆️
#nightly_gpu_tests ?
#unittests_36 14.88% <0%> (-0.18%) ⬇️
#unittests_37 14.89% <0%> (-0.22%) ⬇️
#unittests_gpu11 13.96% <0%> (-0.19%) ⬇️
#unittests_gpu12 13.96% <0%> (-0.19%) ⬇️
Impacted Files Coverage Δ
parlai/tasks/dstc7/agents.py 0% <0%> (ø) ⬆️
parlai/tasks/dstc7/build.py 0% <0%> (ø) ⬆️
...zard_of_wikipedia/full_dialogue_retrieval_model.py 0% <0%> (-100%) ⬇️
parlai/zoo/drqa/squad.py 0% <0%> (-100%) ⬇️
parlai/zoo/fasttext_cc_vectors/build.py 0% <0%> (-100%) ⬇️
...arlai/zoo/wizard_of_wikipedia/end2end_generator.py 0% <0%> (-100%) ⬇️
parlai/zoo/convai2/kvmemnn.py 0% <0%> (-100%) ⬇️
projects/controllable_dialogue/tasks/agents.py 0% <0%> (-100%) ⬇️
...ollable_dialogue/controllable_seq2seq/stopwords.py 0% <0%> (-100%) ⬇️
parlai/zoo/controllable_dialogue/build.py 0% <0%> (-100%) ⬇️
... and 97 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0e2d49c...8570557. Read the comment docs.

Copy link
Contributor

@emilydinan emilydinan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -96,6 +99,17 @@ def share(self):
return shared


class DSTC7TeacherAugmented(DSTC7Teacher):
"""
Augmented.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add more detail in this docstring? what does augmented mean? what is the difference between augmented and augmented sampled?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to be honest, @samhumeau would have a better idea of what exactly this means. I will consult him offline (unless he wants to comment here 😄)

Copy link
Contributor

@stephenroller stephenroller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah expand that docstring like emily says

@klshuster
Copy link
Contributor Author

Updated the docstring after consulting @samhumeau, will merge when tests pass.

@klshuster klshuster merged commit d6d0782 into facebookresearch:master Jan 6, 2020
@klshuster klshuster deleted the dstc7_update branch January 6, 2020 20:33
hadasah pushed a commit that referenced this pull request Jan 7, 2020
* updates to dstc7 task

* black

* update docstring
ggdupont pushed a commit to ggdupont/ParlAI that referenced this pull request Jan 22, 2020
* updates to dstc7 task

* black

* update docstring
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants