9801f28774b8d4aeed7d65025bf2451814c1db6d,chainerrl/agents/ddpg.py,DDPG,batch_act,#DDPG#Any#,347

Before Change


                self.xp, self.phi)
            batch_action = [
                self.policy(batch_xs[i]).sample()
                for i in range(len(batch_obs))]
            // Q is not needed here, but log it just for information
            // q = self.q_function(batch_xs, batch_action)

After Change


        with chainer.using_config("train", False), chainer.no_backprop_mode():
            batch_xs = self.batch_states(batch_obs,
                self.xp, self.phi)
            batch_action = self.policy(batch_xs).sample()
            // Q is not needed here, but log it just for information
            q = self.q_function(batch_xs, batch_action)

        // Update stats
        self.average_q *= self.average_q_decay
        self.average_q += (1 - self.average_q_decay) * float(q.array)
        self.logger.debug("t:%s a:%s q:%s",
                          self.t, batch_action.array[0], q.array)
        return [cuda.to_cpu(action.array) for action in batch_action]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: chainer/chainerrl
Commit Name: 9801f28774b8d4aeed7d65025bf2451814c1db6d
Time: 2019-03-26
Author: prabhat.nagarajan@gmail.com
File Name: chainerrl/agents/ddpg.py
Class Name: DDPG
Method Name: batch_act


Project Name: chartbeat-labs/textacy
Commit Name: eaaf2bad32af4bda1a98d434530926bb6a001230
Time: 2019-08-23
Author: burtdewilde@gmail.com
File Name: textacy/augmentation/transformations.py
Class Name:
Method Name: insert_synonyms


Project Name: HyperGAN/HyperGAN
Commit Name: 345fce3d67cafe3a1728b177d376193f48efd4bd
Time: 2020-02-17
Author: mikkel@255bits.com
File Name: hypergan/samplers/batch_walk_sampler.py
Class Name: BatchWalkSampler
Method Name: __init__


Project Name: Microsoft/nni
Commit Name: 28999d440572b5c18156599df0af46a4bd86d2ec
Time: 2019-06-25
Author: xuehui@microsoft.com
File Name: src/sdk/pynni/nni/metis_tuner/Regression_GMM/Selection.py
Class Name:
Method Name: selection_r


Project Name: uber/pyro
Commit Name: 2a8c7d1976fc74ff9f1075af31f4b9d0482bee53
Time: 2020-05-15
Author: fehiepsi@gmail.com
File Name: tests/ops/test_welford.py
Class Name:
Method Name: test_welford_dense