mirror of
https://github.com/wassname/pytorch-soft-actor-critic.git
synced 2026-09-10 12:22:16 +08:00
Update model.py
This commit is contained in:
@@ -79,7 +79,7 @@ class GaussianPolicy(nn.Module):
|
||||
normal = Normal(mean, std)
|
||||
|
||||
if reparam == True:
|
||||
x_t = mean + std * torch.randn(1,6)
|
||||
x_t = normal.rsample() # or mean + std * torch.randn(1,6)
|
||||
else:
|
||||
x_t = normal.sample()
|
||||
|
||||
@@ -152,4 +152,4 @@ class GaussianMixturePolicy(nn.Module):
|
||||
action = torch.tanh(x_t)
|
||||
|
||||
action = action.detach().cpu().numpy()
|
||||
return action[0]
|
||||
return action[0]
|
||||
|
||||
Reference in New Issue
Block a user