MCPcopy Create free account
hub / github.com/geekcomputers/Python / __init__

Method __init__

ML/src/python/neuralforge/optim/optimizers.py:227–235  ·  view source on GitHub ↗
(self, optimizer, k=5, alpha=0.5)

Source from the content-addressed store, hash-verified

225
226class Lookahead(Optimizer):
227 def __init__(self, optimizer, k=5, alpha=0.5):
228 self.optimizer = optimizer
229 self.k = k
230 self.alpha = alpha
231 self.param_groups = self.optimizer.param_groups
232 self.state = {}
233
234 for group in self.param_groups:
235 group['counter'] = 0
236
237 def update(self, group):
238 for fast_p in group['params']:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected