f2ede1d376601f4f6c905d57ef240e1457f1d00b,chainerrl/agents/c51.py,C51,_compute_loss,#C51#Any#Any#Any#,66

Before Change


        

        self.n_atoms = 51
        self.v_min = 0//-10
        self.v_max = 500/ቦ
        self.delta_z = (self.v_max - self.v_min) / float(self.n_atoms - 1)
        self.z_values = self.xp.array([self.v_min + i * self.delta_z for i in range(self.n_atoms)])

        y, t = self._compute_y_and_t(exp_batch, gamma)

        loss = -F.mean(F.sum(t * F.log(y+1e-5), axis=1))

After Change


    def _compute_loss(self, exp_batch, gamma, errors_out=None):
        Compute a loss of categorical DQN.
        y, t = self._compute_y_and_t(exp_batch, gamma)
        eltwise_loss = -t * F.log(y)
        if self.batch_accumulator == "sum":
            loss = F.sum(eltwise_loss)
        else:
            loss = F.mean(F.sum(eltwise_loss, axis=1))
        return loss
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: chainer/chainerrl
Commit Name: f2ede1d376601f4f6c905d57ef240e1457f1d00b
Time: 2018-03-20
Author: muupan@gmail.com
File Name: chainerrl/agents/c51.py
Class Name: C51
Method Name: _compute_loss


Project Name: facebookresearch/ParlAI
Commit Name: bda270d6255bca6c9518f4f6e8d2cdee8cd6a40c
Time: 2018-08-29
Author: ahm@fb.com
File Name: parlai/agents/seq2seq/modules.py
Class Name: Encoder
Method Name: forward


Project Name: scikit-image/scikit-image
Commit Name: 02c704530eab9c8376b029aab4047babda5c65b8
Time: 2017-10-29
Author: contact@kne42.me
File Name: skimage/measure/_moments.py
Class Name:
Method Name: moments_contour_central