I would like to update the weights of a stylegan generator. I have the weights delta. Is this the correct approach:
def add_weights_delta(generator, weights_delta):
with torch.no_grad():
for name, parameter in generator.named_parameters():
if name in weights_delta:
parameter.data += weights_delta[name]
I tried this and did not get any errors. It seems correct, but just wanted to confirm. e
def add_weights_delta(generator, weights_delta):
with torch.no_grad():
for name, parameter in generator.named_parameters():
if name in weights_delta:
parameter.data += weights_delta[name]
New contributor
user23365379 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.