You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm relatively new to neural networks and Brax, and I'm running into a specific issue. The example I am trying to run is below:
foriinrange(timeSteps):
action=model.forward(observation)
observation, reward, done, info=env.step(action) # Brax env wrapped in VectorGymWrapper and then wrapped in TorchWrapperobservation=observation.requires_grad_()
withtorch.no_grad():
loss+=torch.pow(torch.norm(observation, p=2), 2)
loss=loss/timeStepsprint(loss)
loss.backward()
forname, paraminmodel.named_parameters():
print(name, param.grad)
When I run my example, the param.grad returns None. How can I get the sensitivity of the loss function with respect to the parameters?
I assume that this should be possible, because of the example that was posted here is able to do it:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm relatively new to neural networks and Brax, and I'm running into a specific issue. The example I am trying to run is below:
When I run my example, the param.grad returns None. How can I get the sensitivity of the loss function with respect to the parameters?
I assume that this should be possible, because of the example that was posted here is able to do it:
https://colab.research.google.com/github/google/brax/blob/main/notebooks/training_torch.ipynb
Beta Was this translation helpful? Give feedback.
All reactions