Skip to content

Commit

Permalink
🐛 Fix Deep Ensembles reset_parameters option
Browse files Browse the repository at this point in the history
`network.children()` only iterates on immediate children.
`network.modules()` solves the issue
  • Loading branch information
alafage committed Dec 16, 2024
1 parent d13e0c6 commit eed446e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion torch_uncertainty/models/wrappers/deep_ensembles.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def deep_ensembles(

if reset_model_parameters:
for model in models:
for layer in model.children():
for layer in model.modules():
if hasattr(layer, "reset_parameters"):
layer.reset_parameters()

Expand Down

0 comments on commit eed446e

Please sign in to comment.