MCPcopy Create free account
hub / github.com/PrathamLearnsToCode/paper2code / __init__

Method __init__

skills/paper2code/worked/ddpm/src/utils.py:212–222  ·  view source on GitHub ↗

Args: model: the model to track decay: §4 — "decay factor of 0.9999"

(self, model: nn.Module, decay: float = 0.9999)

Source from the content-addressed store, hash-verified

210 """
211
212 def __init__(self, model: nn.Module, decay: float = 0.9999):
213 """
214 Args:
215 model: the model to track
216 decay: §4 — "decay factor of 0.9999"
217 """
218 self.decay = decay
219 self.shadow = {}
220 for name, param in model.named_parameters():
221 if param.requires_grad:
222 self.shadow[name] = param.data.clone()
223
224 @torch.no_grad()
225 def update(self, model: nn.Module):

Callers 2

__init__Function · 0.45
loss_template.pyFile · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected