peal.global_utils.reset_weights¶
- peal.global_utils.reset_weights(model)[source]¶
Re-initialise a model by calling
reset_parametersrecursively.Descends through the module tree and calls
reset_parameterson every layer that has one, so that a pretrained model can be turned back into a randomly initialised one of the same architecture.- Parameters:
model (
torch.nn.Module) – Model modified in place.