MCPcopy Create free account
hub / github.com/dome272/Diffusion-Models-pytorch / update_average

Method update_average

modules.py:18–21  ·  view source on GitHub ↗
(self, old, new)

Source from the content-addressed store, hash-verified

16 ma_params.data = self.update_average(old_weight, up_weight)
17
18 def update_average(self, old, new):
19 if old is None:
20 return new
21 return old * self.beta + (1 - self.beta) * new
22
23 def step_ema(self, ema_model, model, step_start_ema=2000):
24 if self.step < step_start_ema:

Callers 1

update_model_averageMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected