Skip to content

Commit

Permalink
Remove extra arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kumar-Tarun committed May 16, 2020
1 parent 050589e commit adc705e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
5 changes: 2 additions & 3 deletions main_toefl.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,8 @@
char_vocab_size=len(c2idx), char_embed_dim=50,
dropout1=0.5, dropout2=0, dropout3=0.1, name='toefl')

Transformer_model = Transformer1(emb=300+1024+250+30, k=300, heads=1, depth=1,
seq_length=128, num_tokens=13845, num_classes=2,
char_vocab_size=len(c2idx), char_embed_dim=50, name='toefl')
Transformer_model = Transformer(emb=300+1024+250+30, k=300, heads=1, depth=1,
num_classes=2, char_vocab_size=len(c2idx), char_embed_dim=50, name='toefl')

transformer_parameters = sum(p.numel() for p in Transformer_model.parameters() if p.requires_grad)
rnn_parameters = sum(p.numel() for p in RNNseq_model.parameters() if p.requires_grad)
Expand Down
4 changes: 2 additions & 2 deletions main_vua.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@
dropout1=0.5, dropout2=0, dropout3=0.1)

Transformer_model = Transformer(emb=300+1024+250+30, k=300, heads=1, depth=1,
seq_length=128, num_tokens=13845, num_classes=2,
char_vocab_size=len(c2idx), char_embed_dim=50)
num_classes=2, char_vocab_size=len(c2idx),
char_embed_dim=50)

transformer_parameters = sum(p.numel() for p in Transformer_model.parameters() if p.requires_grad)
rnn_parameters = sum(p.numel() for p in RNNseq_model.parameters() if p.requires_grad)
Expand Down
3 changes: 1 addition & 2 deletions model.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,10 +263,9 @@ def forward(self, x):
return {0:x, 1:pad_amounts}

class Transformer(nn.Module):
def __init__(self, emb, k, heads, depth, seq_length, num_tokens, num_classes, char_vocab_size, char_embed_dim, name='vua'):
def __init__(self, emb, k, heads, depth, num_classes, char_vocab_size, char_embed_dim, name='vua'):
super(Transformer1, self).__init__()

self.num_tokens = num_tokens
self.char_emb = CharCNN(char_vocab_size, char_embed_dim)
self.name = name

Expand Down

0 comments on commit adc705e

Please sign in to comment.