61423919aac550098ab529f70a744af7c5ec0dbe,chainerrl/agents/a2c.py,A2C,batch_observe_and_train,#A2C#Any#Any#Any#Any#,260

Before Change


    def batch_observe_and_train(self, batch_obs, batch_reward, batch_done,
                                batch_reset):

        if any(batch_reset):
            raise RuntimeError("A2C does not support resetting an env withtout reaching a terminal state during training")  // NOQA

        statevar = self.batch_states(batch_obs, self.xp, self.phi)

        self.masks[self.t - self.t_start - 1] =\
            self.xp.array([0.0 if done else 1.0 for done in batch_done])

After Change



        if any(batch_reset):
            warnings.warn("A2C currently does not support resetting an env withtout reaching a terminal state during training. When receiving True in batch_reset, A2C considers it as True in batch_done instead.")  // NOQA
            for i, reset in enumerate(batch_reset):
                if reset:
                    batch_done[i] = True

        statevar = self.batch_states(batch_obs, self.xp, self.phi)

        self.masks[self.t - self.t_start - 1] =\
            self.xp.array([0.0 if done else 1.0 for done in batch_done])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: chainer/chainerrl
Commit Name: 61423919aac550098ab529f70a744af7c5ec0dbe
Time: 2018-10-16
Author: muupan@gmail.com
File Name: chainerrl/agents/a2c.py
Class Name: A2C
Method Name: batch_observe_and_train


Project Name: urinieto/msaf
Commit Name: 638f4e7841bbc9f7057d961b60a6d951424ceb9a
Time: 2016-09-20
Author: oriol.nieto@gmail.com
File Name: msaf/run.py
Class Name:
Method Name: run_hierarchical


Project Name: mne-tools/mne-python
Commit Name: 7c1233ba612bdb08d640c924ef4220b2fe13fb71
Time: 2020-09-25
Author: larson.eric.d@gmail.com
File Name: mne/io/reference.py
Class Name:
Method Name: add_reference_channels