Skip to content

L4: Practical loss-based stepsize adaptation for PyTorch

Notifications You must be signed in to change notification settings

iovdin/l4-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

l4-pytorch

This is PyTorch implementation of "L4: Practical loss-based stepsize adaptation for deep learning" By Michal Rolínek, Georg Martius.

To install put l4.py to working directory

from l4 import L4

#...

optimizer = optim.SGD(model.parameters(), lr=args.lr, momentum=args.momentum)                                                           | create mode 100644 l4.py                                                                                                                  
# wrap original optimizer with L4
l4opt = L4(optimizer) 

#...

loss = F.nll_loss(output, target)
loss.backward() 

# Comment out original optimizer step
# optimizer.step()

# make step with L4 optimizer, dont forget to pass loss value
l4opt.step(loss)  

Tensorflow implementation can be found here

About

L4: Practical loss-based stepsize adaptation for PyTorch

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages