MCPcopy Create free account
hub / github.com/KeepTryingTo/Pytorch-GAN / __call__

Method __call__

StyleGAN/utils.py:121–129  ·  view source on GitHub ↗
(self, model)

Source from the content-addressed store, hash-verified

119 self.registered[name] = param.clone().detach()
120
121 def __call__(self, model):
122 self.count += 1
123 for name, param in model.named_parameters():
124 if param.requires_grad:
125 new_weight = param.clone().detach() if name not in self.registered else self.gamma * param + (1 - self.gamma) * self.registered[name]
126 self.registered[name] = new_weight
127
128 if self.count % self.save_frequency == 0:
129 self.save_ema_weights()
130
131 def copy_weights_to(self, model):
132 for name, param in model.named_parameters():

Callers

nothing calls this directly

Calls 1

save_ema_weightsMethod · 0.95

Tested by

no test coverage detected