Open
Conversation
Optional ITM loss in pre-training added.
vedanuj
suggested changes
Aug 31, 2021
Contributor
vedanuj
left a comment
There was a problem hiding this comment.
Thanks for contributing to MMF. Requesting some changes before this is ready to merge.
In addition, have you tried running this model? How have you tested this change?
mmf/models/vilbert.py
Outdated
| output["masked_lm_loss"] = masked_lm_loss.unsqueeze(0) | ||
|
|
||
| if itm_loss is not False: | ||
| itm_head = ITM({"type": "itm", "hidden_size": self.vocab_size}) |
Contributor
There was a problem hiding this comment.
This should be initialized in the init not in the forward pass.
Author
There was a problem hiding this comment.
Hi! corrected the initialization thing. I checked the snippet I added separately in similar manner to "ITM head test" but was not able to test the ViLBERTForPretraining (As after loading yaml file its throwing 'dict' object has no attribute 'bert_model_name') even without making changes in original code.
ITM head initialization under init instead of forward pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Optional ITM loss in pre-training added for VilBERT.
Addresses #466
Thanks for your contribution!
If you're sending a large PR (e.g., >50 lines), please open an issue first about
the feature/bug, and indicate how you want to contribute.
Use contributing guidelines before opening up the PR to follow MMF style guidelines.