809d0e5b52561fefd3b0d98c08d3cbb175d7e706,onmt/Models.py,Encoder,forward,#Encoder#Any#Any#Any#,125
Before Change
if self.encoder_layer == "mean":
// Take the mean of vectors.
mean = pre_emb.mean(0).view(1, pre_emb.size(1), pre_emb.size(2)) \
.expand(self.layers, pre_emb.size(1), pre_emb.size(2))
return (mean, mean), pre_emb
elif self.encoder_layer == "transformer":
// Self-attention tranformer.
After Change
out = emb.transpose(0, 1).contiguous()
for i in range(self.layers):
out = self.transformer[i](out, input[:, :, 0])
return Variable(emb.data) , out.transpose(0, 1).contiguous()
else:
// Standard RNN encoder.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: OpenNMT/OpenNMT-py
Commit Name: 809d0e5b52561fefd3b0d98c08d3cbb175d7e706
Time: 2017-07-04
Author: sasha.rush@gmail.com
File Name: onmt/Models.py
Class Name: Encoder
Method Name: forward
Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 54a0f981802ccb86350033a42c3cedd114efc49d
Time: 2017-09-24
Author: ikostrikov@gmail.com
File Name: main.py
Class Name:
Method Name: main
Project Name: jwyang/faster-rcnn.pytorch
Commit Name: f860a09e81ea4bff1f14014e936803a72868959d
Time: 2017-08-30
Author: echosenm@gmail.com
File Name: lib/model/faster_rcnn/faster_rcnn_cascade.py
Class Name: _RCNN_base
Method Name: forward