65c9a4857e41dcde4f5dae8a77e6cdf03953646a,model/model.py,RNNFeaturizer,forward,#RNNFeaturizer#Any#Any#,70
Before Change
if self.all_layers:
cell = torch.cat(cell, -1)
else:
cell = cell[-1]
// get last valid cell state
if seq_len is not None:
cell = cell[(seq_len-1).view(-1).contiguous(), torch.arange(cell.size(1)).long().cuda()]
else:
cell = cell[-1]
return cell
After Change
def forward(self, input, seq_len=None):
self.rnn.detach_hidden()
if seq_len is None:
for i in range(input.size(0)):
emb = self.drop(self.encoder(input[i]))
_, hidden = self.rnn(emb.unsqueeze(0), collectHidden=True)
cell = self.get_cell_features(hidden)
else:
last_cell = 0
for i in range(input.size(0)):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: NVIDIA/sentiment-discovery
Commit Name: 65c9a4857e41dcde4f5dae8a77e6cdf03953646a
Time: 2018-03-19
Author: raulp@dbcluster.nvidia.com
File Name: model/model.py
Class Name: RNNFeaturizer
Method Name: forward
Project Name: BindsNET/bindsnet
Commit Name: 25fbc56b910b394c02f0c2673630f602899ddc56
Time: 2018-05-25
Author: djsaunde@cs.umass.edu
File Name: examples/mnist/conv_mnist.py
Class Name:
Method Name:
Project Name: dnouri/skorch
Commit Name: a7cd7a15a9baf741f2b4fcd32f3d8055827889b5
Time: 2017-08-08
Author: marian.tietz@ottogroup.com
File Name: examples/word_language_model/predict.py
Class Name:
Method Name: