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
Add sse model #168
Conversation
There was a problem hiding this 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__() |
There was a problem hiding this comment.
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): | ||
|
There was a problem hiding this comment.
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()] |
There was a problem hiding this comment.
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.
@daemon All of your comments fixed. |
LG |
Reference:
Paper: Shortcut-Stacked Sentence Encoders for Multi-Domain Inference
Code: https://github.com/easonnie/multiNLI_encoder
@likicode @daemon Could you review this PR?