583e6a38f9a7e399e8378f18dfc991591bdf781a,models/pos/model.py,Tagger,__init__,#Tagger#Any#Any#Any#,10
Before Change
self.upos_emb = nn.Embedding(len(vocab["upos"]), self.args["tag_emb_dim"], padding_idx=0)
// char embeddings
self.char_emb = nn.Embedding(len(vocab["char"]), self.args["char_emb_dim"], padding_idx=0)
// modules
self.charlstm = PackedLSTM(self.args["char_emb_dim"], self.args["char_hidden_dim"], self.args["char_num_layers"], batch_first=True)
After Change
// criteria
self.upos_crit = nn.CrossEntropyLoss(ignore_index=0) // ignore padding
self.drop = nn.Dropout(args["dropout"])
def forward(self, word, word_mask, wordchars, wordchars_mask, upos, xpos, ufeats, pretrained, word_orig_idx, sentlens):
char_reps = self.charmodel(wordchars, wordchars_mask, word_orig_idx, sentlens)
pretrained_emb = self.pretrained_emb(pretrained)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: stanfordnlp/stanza
Commit Name: 583e6a38f9a7e399e8378f18dfc991591bdf781a
Time: 2018-08-27
Author: qipeng@users.noreply.github.com
File Name: models/pos/model.py
Class Name: Tagger
Method Name: __init__
Project Name: allenai/allennlp
Commit Name: 700abc65fd2172a2c6809dd9b72cf50fc2407772
Time: 2020-02-03
Author: mattg@allenai.org
File Name: allennlp/models/encoder_decoders/composed_seq2seq.py
Class Name: ComposedSeq2Seq
Method Name: __init__
Project Name: dmlc/dgl
Commit Name: 6f4898a128ebc5227e312640508629b50b32571b
Time: 2018-12-02
Author: yma@yma.io
File Name: examples/mxnet/gcn/gcn_batch.py
Class Name: GCN
Method Name: forward