a6652b0c1997bb47dd502bf674e0b3b9b2d09d23,examples/reinforcement_learning/tutorial_bipedalwalker_a3c_continuous_action.py,ACNet,choose_action,#ACNet#Any#,162

Before Change



    def choose_action(self, s):  // run by a local
        s = s[np.newaxis, :]
        return sess.run(self.A, {self.s: s})[0]

    def save_ckpt(self):
        tl.files.exists_or_mkdir(self.scope)

After Change


        with tf.name_scope("wrap_a_out"):
            self.mu, self.sigma = self.mu * A_BOUND[1], self.sigma + 1e-5
        normal_dist = tfd.Normal(self.mu, self.sigma)   // for continuous action space
        self.A = tf.clip_by_value(tf.squeeze(normal_dist.sample(1), axis=0), *A_BOUND)
        return self.A.numpy()[0]

    def save_ckpt(self): // save trained weights
        tl.files.save_npz(self.actor.trainable_weights, name="model_actor.npz")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorlayer/tensorlayer
Commit Name: a6652b0c1997bb47dd502bf674e0b3b9b2d09d23
Time: 2019-05-16
Author: 1402434478@qq.com
File Name: examples/reinforcement_learning/tutorial_bipedalwalker_a3c_continuous_action.py
Class Name: ACNet
Method Name: choose_action


Project Name: reinforceio/tensorforce
Commit Name: e2d3382bb4132ddb8aa586bf3c4c570be414f6af
Time: 2017-03-26
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/policies/gaussian_policy.py
Class Name: GaussianPolicy
Method Name: sample


Project Name: tensorlayer/tensorlayer
Commit Name: 6ca2a6359dc1374bfb211da8680f3d5f319cdaa5
Time: 2019-05-16
Author: 1402434478@qq.com
File Name: examples/reinforcement_learning/tutorial_bipedalwalker_a3c_continuous_action.py
Class Name: ACNet
Method Name: choose_action


Project Name: reinforceio/tensorforce
Commit Name: e2d3382bb4132ddb8aa586bf3c4c570be414f6af
Time: 2017-03-26
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/models/policies/categorical_one_hot_policy.py
Class Name: CategoricalOneHotPolicy
Method Name: sample