4cbcf46bb80ecfbfedcd3e2872669d3aa96f5e27,stanfordnlp/models/common/char_model.py,CharacterLanguageModel,forward,#CharacterLanguageModel#,76
Before Change
if self.pad:
res = pad_packed_sequence(res, batch_first=True)[0]
return res
After Change
self.charlstm_c_init.expand(self.args["char_num_layers"], batch_size, self.args["char_hidden_dim"]).contiguous())
output, hidden = self.charlstm(embs, charlens, hx=hidden)
output = self.dropout(pad_packed_sequence(output, batch_first=True)[0])
decoded = self.decoder(output)
return output, hidden, decoded
def get_representation(self, chars, charoffsets, charlens, char_orig_idx):
with torch.no_grad(): //TODO: remove
output, _, _ = self.forward(chars, charlens)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: stanfordnlp/stanza
Commit Name: 4cbcf46bb80ecfbfedcd3e2872669d3aa96f5e27
Time: 2019-09-06
Author: zyh.thu@gmail.com
File Name: stanfordnlp/models/common/char_model.py
Class Name: CharacterLanguageModel
Method Name: forward
Project Name: XifengGuo/CapsNet-Keras
Commit Name: 37f599f61067cc6947c9bf783eace05227c0f450
Time: 2017-11-13
Author: guoxifeng1990@163.com
File Name: capsulenet.py
Class Name:
Method Name: CapsNet
Project Name: pytorch/examples
Commit Name: 632d385444ae16afe3e4003c94864f9f97dc8541
Time: 2019-09-04
Author: hongyu@mail.com
File Name: word_language_model/model.py
Class Name: RNNModel
Method Name: forward