MCPcopy
hub / github.com/ermongroup/ddim / update

Method update

models/ema.py:16–22  ·  view source on GitHub ↗
(self, module)

Source from the content-addressed store, hash-verified

14 self.shadow[name] = param.data.clone()
15
16 def update(self, module):
17 if isinstance(module, nn.DataParallel):
18 module = module.module
19 for name, param in module.named_parameters():
20 if param.requires_grad:
21 self.shadow[name].data = (
22 1. - self.mu) * param.data + self.mu * self.shadow[name].data
23
24 def ema(self, module):
25 if isinstance(module, nn.DataParallel):

Callers 5

trainMethod · 0.95
downloadFunction · 0.80
bar_updateFunction · 0.80
check_integrityFunction · 0.80
_save_response_contentFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected