Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor to conform to the general practice used #184

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mengf821
Copy link

No description provided.

Copy link
Member

@Victor0118 Victor0118 left a comment

Choose a reason for hiding this comment

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

LGTM!


output = self.model(sent1, sent2, batch.ext_feats, batch.dataset.word_to_doc_cnt, batch.sentence_1_raw, batch.sentence_2_raw)
if hasattr(self.model, 'skip_embedding_lookup') and self.model.skip_embedding_lookup:
Copy link
Member

Choose a reason for hiding this comment

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

Why there are two conditions here? What if only one condition is True?

@@ -15,10 +15,13 @@ def train_epoch(self, epoch):
for batch_idx, batch in enumerate(self.train_loader):
self.optimizer.zero_grad()

# Select embedding
sent1, sent2 = self.get_sentence_embeddings(batch)
if hasattr(self.model, 'skip_embedding_lookup') and self.model.skip_embedding_lookup:
Copy link
Member

Choose a reason for hiding this comment

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

same question

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants