Skip to content

A pip installable version of the Lookahead wrapper for Pytorch Optimizers. Exposes an explicit pullback method for easier use in adversarial settings.

Notifications You must be signed in to change notification settings

Jonas-Metzger/lookahead-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 

Repository files navigation

first

pip install git+https://github.com/Jonas-Metzger/lookahead-pytorch.git

then just wrap another optimizer:

from lookahead import Lookahead, OAdam
optim = Lookahead(OAdam(model.parameters(), lr=lr))

during your training loop, insert

if step % 3 == 0: optim.pullback()

About

A pip installable version of the Lookahead wrapper for Pytorch Optimizers. Exposes an explicit pullback method for easier use in adversarial settings.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages