9ddaacb9e73ac061c08403e16ac1a4d5364dca9b,mushroom_rl/algorithms/value/dqn/rainbow.py,RainbowNetwork,forward,#RainbowNetwork#Any#Any#Any#,37

Before Change


        a_pa = [self._pa[i](features) for i in range(self._n_output)]
        a_pa = torch.stack(a_pa, dim=0)
        mean_a_pa = a_pa.mean(0)
        softmax = [F.softmax(a_pv + a_pa[i] - mean_a_pa, -1) for i in range(self._n_output)]
        softmax = torch.stack(softmax, dim=1)

        if not get_distribution:
            q = torch.empty(softmax.shape[:-1])
            for i in range(softmax.shape[0]):

After Change


        a_pv = self._pv(features)
        a_pa = [self._pa[i](features) for i in range(self._n_output)]
        a_pa = torch.stack(a_pa, dim=1)
        a_pv = a_pv.unsqueeze(1).repeat(1, self._n_output, 1)
        mean_a_pa = a_pa.mean(1, keepdim=True).repeat(1, self._n_output, 1)
        softmax = F.softmax(a_pv + a_pa - mean_a_pa, dim=-1)

        if not get_distribution:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 9ddaacb9e73ac061c08403e16ac1a4d5364dca9b
Time: 2021-02-10
Author: carlo.deramo@gmail.com
File Name: mushroom_rl/algorithms/value/dqn/rainbow.py
Class Name: RainbowNetwork
Method Name: forward


Project Name: ixaxaar/pytorch-dnc
Commit Name: 2026a8939d9ccc3e26ac776db5b4788846fd166c
Time: 2017-12-03
Author: root@ixaxaar.in
File Name: dnc/sparse_memory.py
Class Name: SparseMemory
Method Name: read_from_sparse_memory


Project Name: SPFlow/SPFlow
Commit Name: 82478ffacdd98fcc0750ff086af240a3f37a8b10
Time: 2019-08-22
Author: steven.lang.mz@gmail.com
File Name: src/spn/algorithms/layerwise/layers.py
Class Name: Product
Method Name: forward