MCPcopy Index your code
hub / github.com/TorchSSL/TorchSSL / update

Method update

train_utils.py:366–371  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

364 self.shadow[name] = param.data.clone()
365
366 def update(self):
367 for name, param in self.model.named_parameters():
368 if param.requires_grad:
369 assert name in self.shadow
370 new_average = (1.0 - self.decay) * param.data + self.decay * self.shadow[name]
371 self.shadow[name] = new_average.clone()
372
373 def apply_shadow(self):
374 for name, param in self.model.named_parameters():

Callers 15

warmupMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45
warmupMethod · 0.45
trainMethod · 0.45
trainMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected