e07f9a24e60a8acc756efc0728adb257d0474c2f,catalyst/rl/agent/policy.py,GaussPolicy,forward,#GaussPolicy#Any#Any#Any#,33
Before Change
log_pi = normal_logprob(mu, sigma, z)
action, log_pi = self.squashing_layer.forward(z, log_pi)
if logprob:
return action, log_pi
return action
class RealNVPPolicy(nn.Module):
def __init__(
After Change
scale = torch.exp(log_scale)
action = loc if deterministic else normal_sample(loc, scale)
bool_logprob = isinstance(logprob, bool) and logprob
value_logprob = isinstance(logprob, torch.Tensor)
assert not value_logprob, "Not implemented behaviour"
action_logprob = normal_logprob(loc, scale, action)
action, action_logprob = \
self.squashing_layer.forward(action, action_logprob)
if bool_logprob:
return action, action_logprob
else:
return action
class RealNVPPolicy(nn.Module):
def __init__(
self,
action_size,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 13
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: GaussPolicy
Method Name: forward
Project Name: catalyst-team/catalyst
Commit Name: e07f9a24e60a8acc756efc0728adb257d0474c2f
Time: 2019-07-23
Author: scitator@gmail.com
File Name: catalyst/rl/agent/policy.py
Class Name: RealNVPPolicy
Method Name: forward
Project Name: catalyst-team/catalyst
Commit Name: e07f9a24e60a8acc756efc0728adb257d0474c2f
Time: 2019-07-23
Author: scitator@gmail.com
File Name: catalyst/rl/agent/policy.py
Class Name: GaussPolicy
Method Name: forward