282e4e3255fd0be7c2df6f4a1ef2bbedf4eb7f82,captioning/models/AttModel.py,AttModel,init_hidden,#AttModel#,98
Before Change
self.bad_endings_ix = [int(k) for k,v in self.vocab.items() if v in bad_endings]
def init_hidden(self, bsz):
weight = next(self.parameters() )
return (weight.new_zeros(self.num_layers, bsz, self.rnn_size),
weight.new_zeros(self.num_layers, bsz, self.rnn_size))
After Change
def init_hidden(self, bsz):
weight = self.logit.weight \
if hasattr(self.logit, "weight") \
else self .logit[0 ].weight
return (weight.new_zeros(self.num_layers, bsz, self.rnn_size),
weight.new_zeros(self.num_layers, bsz, self.rnn_size))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: 282e4e3255fd0be7c2df6f4a1ef2bbedf4eb7f82
Time: 2020-07-30
Author: rluo@ttic.edu
File Name: captioning/models/AttModel.py
Class Name: AttModel
Method Name: init_hidden
Project Name: jwyang/faster-rcnn.pytorch
Commit Name: 0a7220ed201eee2ad463264a72d5ce42c33dbcc1
Time: 2017-08-25
Author: jw2.yang@gmail.com
File Name: trainval_net.py
Class Name:
Method Name: