Args: model: the model to track decay: §4 — "decay factor of 0.9999"
(self, model: nn.Module, decay: float = 0.9999)
| 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): |
no outgoing calls
no test coverage detected