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

Add sse model #168

Merged
merged 9 commits into from Dec 18, 2018
Merged

Add sse model #168

merged 9 commits into from Dec 18, 2018

Conversation

Victor0118
Copy link
Member

@Victor0118 Victor0118 commented Dec 3, 2018

Reference:
Paper: Shortcut-Stacked Sentence Encoders for Multi-Domain Inference
Code: https://github.com/easonnie/multiNLI_encoder

@likicode @daemon Could you review this PR?

@daemon daemon self-requested a review December 16, 2018 02:59
Copy link
Member

@daemon daemon left a comment

Choose a reason for hiding this comment

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

Minor changes.

sse/model.py Outdated

class StackBiLSTMMaxout(nn.Module):
def __init__(self, h_size=[512, 1024, 2048], d=300, mlp_d=1600, dropout_r=0.1, max_l=60, num_classes=3):
super(StackBiLSTMMaxout, self).__init__()
Copy link
Member

Choose a reason for hiding this comment

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

super().__init__() suffices.

import numpy as np

def auto_rnn_bilstm(lstm: nn.LSTM, seqs, lengths):

Copy link
Member

Choose a reason for hiding this comment

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

Double-spaced code?

sse/__main__.py Outdated
if not args.skip_training:
total_params = 0
for param in model.parameters():
size = [s for s in param.size()]
Copy link
Member

Choose a reason for hiding this comment

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

total_params = sum(p.numel() for p in model.parameters()) is more concise.

@Victor0118
Copy link
Member Author

@daemon All of your comments fixed.

@daemon
Copy link
Member

daemon commented Dec 18, 2018

LG

@Victor0118 Victor0118 merged commit 57f53a8 into castorini:master Dec 18, 2018
@Victor0118 Victor0118 deleted the add-sse branch December 18, 2018 02:05
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.

None yet

2 participants