22bd62194e97151e6354edd4d04a3c414083cc9c,model.py,DQN,forward,#DQN#Any#,16

Before Change


    x = self.relu(self.conv3(x))
    x = x.view(x.size(0), -1)
    x = self.relu(self.fc1(x))
    v = self.fc_v(x)
    a = self.fc_a(x)
    return v.expand_as(a) + a - a.mean(1, keepdim=True).expand_as(a)

After Change


    x = self.relu(self.conv3(x))
    x = x.view(x.size(0), -1)
    x = self.relu(self.fc1(x))
    p = torch.stack([self.softmax(z).clamp(min=1e-8, max=1 - 1e-8) for z in self.fc_z(x).chunk(self.action_space, 1)], 1)
    return p  // Probabilities with action over second dimension
    // v = self.fc_v(x)
    // a = self.fc_a(x)
    // return v.expand_as(a) + a - a.mean(1, keepdim=True).expand_as(a)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: Kaixhin/Rainbow
Commit Name: 22bd62194e97151e6354edd4d04a3c414083cc9c
Time: 2017-11-05
Author: design@kaixhin.com
File Name: model.py
Class Name: DQN
Method Name: forward


Project Name: facebookresearch/pytext
Commit Name: 78c4f927b3041914694399b5532ac532d8967114
Time: 2019-02-26
Author: mikaell@fb.com
File Name: pytext/loss/loss.py
Class Name: KLDivergenceCELoss
Method Name: __call__


Project Name: rusty1s/pytorch_geometric
Commit Name: 45a03ac258234ba49c0a43d46ae022493190591e
Time: 2019-03-26
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/autoencoder.py
Class Name: ARGA
Method Name: discriminator_loss