Lookahead synchronizes only every k fast steps. Choosing k sets how often the slow weights are updated, with the fast optimizer running in between.
Implement sync_steps(total, k), the step numbers at which a sync happens.
Keep each step whose number is a multiple of k.
No results yet
Run your code to check it against the examples, or submit to run every test.