38c6a56381f2f93fd0fb819f81be26df86a6a0e1,python/baseline/pytorch/seq2seq/model.py,Seq2SeqAttnModel,__init__,#Seq2SeqAttnModel#Any#Any#,246

Before Change


        self.preds = nn.Linear(self.hsz, self.nc)
        self.probs = nn.LogSoftmax(dim=1)
        self.output_to_attn = nn.Linear(self.hsz, self.hsz, bias=False)
        self.attn_softmax = nn.Softmax(dim=1)
        self.attn_out = nn.Linear(2 * self.hsz, self.hsz, bias=False)
        self.attn_tanh = pytorch_activation("tanh")
        self.nlayers = nlayers

After Change


        self.probs = nn.LogSoftmax(dim=1)
        self.nlayers = nlayers
        attn_type = kwargs.get("attn_type", "luong").lower()
        if attn_type == "dot":
            self.attn_module = LuongDotProductAttention(enc_hsz)
        else:
            self.attn_module = LuongGeneralAttention(enc_hsz)

    def attn(self, output_t, context, src_mask=None):
        return self.attn_module(output_t, context, context, src_mask)

    def bridge(self, final_encoder_state, context):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dpressel/mead-baseline
Commit Name: 38c6a56381f2f93fd0fb819f81be26df86a6a0e1
Time: 2018-08-13
Author: dpressel@gmail.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: Seq2SeqAttnModel
Method Name: __init__


Project Name: explosion/thinc
Commit Name: 0db408d1eea2ce5c1d9b20fe61cb519e059d6cef
Time: 2017-09-15
Author: honnibal+gh@gmail.com
File Name: examples/basic_tagger.py
Class Name:
Method Name: main


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 86aca57545cfe312151cc35528035cd9c0aafe2d
Time: 2018-05-17
Author: M.N.Tran@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: class_gradient