Hello everyone,
How to reset the parameters of layer4 in resnet18, using the Module.apply?  Here my code but it doesn’t work.
Thank you.
def reset_weights(m):
    for name, layer in m.named_children():
        if name=='layer4' and hasattr(layer, 'reset_parameters'):
                print(f'Reset trainable parameters of layer = {layer}')
                layer.reset_parameters()

model.appy(reset_weight)