Skip to content

jxbz/fromage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

27 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Fromage πŸ§€ optimiser

JeremyΒ Bernstein   Β·   ArashΒ Vahdat   Β·   YisongΒ Yue   Β·   Ming‑YuΒ Liu

Voulez-vous du fromage?

To get started with Fromage in your Pytorch code, copy the file fromage.py into your project directory, then write:

from fromage import Fromage
optimizer = Fromage(net.parameters(), lr=0.01)

We found an initial learning rate of 0.01 worked well in all experiments except model fine-tuning, where we used 0.001. You may want to experiment with learning rate decay schedules.

About this repository

We've written an academic paper that proposes an optimisation algorithm based on a new geometric characterisation of deep neural networks. The paper is called:

On the distance between two neural networks and the stability of learning.

We're putting this code here so that you can test out our optimisation algorithm in your own applications, and also so that you can attempt to reproduce the experiments in our paper.

If something isn't clear or isn't working, let us know in the Issues section or contact bernstein@caltech.edu.

Repository structure

Here is the structure of this repository.

.
β”œβ”€β”€ classify-cifar/         # CIFAR-10 classification experiments. βœ…
β”œβ”€β”€ classify-imagenet/      # Imagenet classification experiments. Coming soon! πŸ•’
β”œβ”€β”€ classify-mnist/         # MNIST classification experiments. βœ…
β”œβ”€β”€ finetune-transformer/   # Transformer fine-tuning experiments. βœ…
β”œβ”€β”€ generate-cifar/         # CIFAR-10 class-conditional GAN experiments. βœ…
β”œβ”€β”€ make-plots/             # Code to reproduce the figures in the paper. βœ…
β”œβ”€β”€ LICENSE                 # The license on our algorithm. βœ…
β”œβ”€β”€ README.md               # The very page you're reading now. βœ…
└── fromage.py              # Pytorch code for the Fromage optimiser. βœ…

Check back in a few days if the code you're after is missing. We're currently cleaning and posting it.

Acknowledgements

Citation

If you adore le fromage as much as we do, feel free to cite the paper:

@misc{fromage2020,
    title={On the distance between two neural networks and the stability of learning},
    author={Jeremy Bernstein and Arash Vahdat and Yisong Yue and Ming-Yu Liu},
    year={2020},
    eprint={arXiv:2002.03432}
}

License

We are making our algorithm available under a CC BY-NC-SA 4.0 license. The other code we have used obeys other license restrictions as indicated in the subfolders.