-
Notifications
You must be signed in to change notification settings - Fork 290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature] Reset parameters of multiagent networks #1967
Comments
Even when resetting through the dedicated from tensordict.nn import TensorDictModule
from torch import nn
from torchrl.modules.models.multiagent import MultiAgentMLP
if __name__ == "__main__":
actor_net = MultiAgentMLP(
n_agent_inputs=4,
n_agent_outputs=6,
n_agents=2,
centralised=False,
share_params=False,
device="cpu",
depth=2,
num_cells=256,
activation_class=nn.Tanh,
)
policy_module = TensorDictModule(
actor_net,
in_keys=[("agents", "observation")],
out_keys=[("agents", "action")],
)
params_before = list(policy_module.parameters())
policy_module.reset_parameters_recursive()
params_after = list(policy_module.parameters())
for p1, p2 in zip(params_before, params_after):
assert (p1 != p2).all() |
That sounds like something we should support! I have a limited bandwidth and that doesn't seem very complex so feel free to submit a PR if you need this (semi-)urgently |
Do we have any insights of why |
From what I investigated it seems like when I made a PR to warn when this is a no-op Will make another PR to implement |
Hello!
So I usually used a function like this to reset parameters of the multiagent networks
After #1921 this seems to have no effect.
Is there a suggested way to reset the parameters?
Thanks!
The text was updated successfully, but these errors were encountered: