MCPcopy Create free account
hub / github.com/AtlasAnalyticsLab/AdaFisher / step

Method step

Analysis/optimizers/kfac.py:174–190  ·  view source on GitHub ↗
(self, closure=None)

Source from the content-addressed store, hash-verified

172 p.data.add_(d_p, alpha=-group['lr'])
173
174 def step(self, closure=None):
175 # FIXME(CW): temporal fix for compatibility with Official LR scheduler.
176 group = self.param_groups[0]
177 lr = group['lr']
178 damping = group['damping']
179 updates = {}
180 for m in self.modules:
181 classname = m.__class__.__name__
182 if self.steps % self.TInv == 0:
183 self._update_inv(m)
184 p_grad_mat = self._get_matrix_form_grad(m, classname)
185 v = self._get_natural_grad(m, p_grad_mat, damping)
186 updates[m] = v
187 self._kl_clip_and_update_grad(updates, lr)
188
189 self._step(closure)
190 self.steps += 1

Callers

nothing calls this directly

Calls 5

_update_invMethod · 0.95
_get_matrix_form_gradMethod · 0.95
_get_natural_gradMethod · 0.95
_stepMethod · 0.95

Tested by

no test coverage detected