e07f9a24e60a8acc756efc0728adb257d0474c2f,catalyst/rl/agent/policy.py,CategoricalPolicy,forward,#CategoricalPolicy#Any#Any#Any#,13

Before Change


            not isinstance(logprob, bool) and logprob is not None
        if flag_bool or flag_value:
            // @TODO: refactor
            log_pi = dist.log_prob(logprob)
            return action, log_pi
        return action


class GaussPolicy(nn.Module):

After Change


            if deterministic \
            else dist.sample()

        return _distribution_forward(dist, action, logprob)


class BernoulliPolicy(nn.Module):
    def forward(self, logits, logprob=None, deterministic=False):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Scitator/catalyst
Commit Name: e07f9a24e60a8acc756efc0728adb257d0474c2f
Time: 2019-07-23
Author: scitator@gmail.com
File Name: catalyst/rl/agent/policy.py
Class Name: CategoricalPolicy
Method Name: forward


Project Name: facebookresearch/Horizon
Commit Name: 559656ad26529e5c408de1390db194128520eb7e
Time: 2020-08-04
Author: kaiwenw@fb.com
File Name: reagent/models/actor.py
Class Name: GaussianFullyConnectedActor
Method Name: get_log_prob