59bcf379c51da12beee63d4fc7913ee74c4f9e8d,onmt/modules/CopyGenerator.py,CopyGeneratorCriterion,__call__,#CopyGeneratorCriterion#Any#Any#Any#,113
Before Change
self.pad = pad
def __call__(self, scores, align, target):
align = align.view(-1)
// Copy prob.
out = scores.gather(1, align.view(-1, 1) + self.offset) \
.view(-1).mul(align.ne(0).float())
After Change
// Add score for non-unks in target
out = out + tmp.mul(target_not_unk)
// Add score for when word is unk in both align and tgt
out = out + tmp.mul(align_unk).mul(target_unk)
else:
// Forced copy. Add only probability for not-copied tokens
out = out + tmp.mul(align_unk)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: OpenNMT/OpenNMT-py
Commit Name: 59bcf379c51da12beee63d4fc7913ee74c4f9e8d
Time: 2018-02-06
Author: s.gehrmann@outlook.com
File Name: onmt/modules/CopyGenerator.py
Class Name: CopyGeneratorCriterion
Method Name: __call__
Project Name: analysiscenter/batchflow
Commit Name: ac83c1456d57a25460af531606c62596836334cf
Time: 2020-02-06
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/torch/layers/resize.py
Class Name: SEBlock
Method Name: forward
Project Name: analysiscenter/batchflow
Commit Name: ac83c1456d57a25460af531606c62596836334cf
Time: 2020-02-06
Author: Tsimfer.SA@gazprom-neft.ru
File Name: batchflow/models/torch/layers/resize.py
Class Name: ReduceDim
Method Name: forward