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

Method update_model_average

modules.py:13–16  ·  view source on GitHub ↗
(self, ma_model, current_model)

Source from the content-addressed store, hash-verified

11 self.step = 0
12
13 def update_model_average(self, ma_model, current_model):
14 for current_params, ma_params in zip(current_model.parameters(), ma_model.parameters()):
15 old_weight, up_weight = ma_params.data, current_params.data
16 ma_params.data = self.update_average(old_weight, up_weight)
17
18 def update_average(self, old, new):
19 if old is None:

Callers 1

step_emaMethod · 0.95

Calls 1

update_averageMethod · 0.95

Tested by

no test coverage detected