e2d3382bb4132ddb8aa586bf3c4c570be414f6af,tensorforce/models/policies/categorical_one_hot_policy.py,CategoricalOneHotPolicy,sample,#CategoricalOneHotPolicy#Any#Any#,44

Before Change


        return self.dist

    def sample(self, state, sample=True):
        output_dist = self.session.run(self.outputs, {self.state: [state]})
        output_dist = output_dist.ravel()

        if sample:
            action = self.dist.sample(dict(policy_output=output_dist))

After Change


        return self.dist

    def sample(self, state, sample=True):
        sample = super(CategoricalOneHotPolicy, self).sample(state)
        output_dist = sample[0]

        output_dist = output_dist.ravel()
        if sample:
            action = self.dist.sample(dict(policy_output=output_dist))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


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


Project Name: rail-berkeley/softlearning
Commit Name: a4026810d414acf11d44778ae004b5e39405f19e
Time: 2018-07-29
Author: kristian.hartikainen@gmail.com
File Name: softlearning/policies/latent_space_policy.py
Class Name: LatentSpacePolicy
Method Name: actions_for


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