All Projects → martius-lab → L4 Optimizer

martius-lab / L4 Optimizer

Licence: mit
Code for paper "L4: Practical loss-based stepsize adaptation for deep learning"

Projects that are alternatives of or similar to L4 Optimizer

Skills Ml
Data Processing and Machine learning methods for the Open Skills Project
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Understandingbdl
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Alfnet
Code for 'Learning Efficient Single-stage Pedestrian Detectors by Asymptotic Localization Fitting' in ECCV2018
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
First Order Model
This repository contains the source code for the paper First Order Motion Model for Image Animation
Stars: ✭ 11,964 (+9395.24%)
Mutual labels:  jupyter-notebook
Modular Rl
[ICML 2020] PyTorch Code for "One Policy to Control Them All: Shared Modular Policies for Agent-Agnostic Control"
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Teaching Monolith
Data science teaching materials
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Pytorch Model Zoo
A collection of deep learning models implemented in PyTorch
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Python
利用python来分析一些财务报表数据
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Distance Encoding
Distance Encoding for GNN Design
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Normalizing Flows
Understanding normalizing flows
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Geostatsmodels
This is a collection of geostatistical scripts written in Python
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Scir Training Day
a small training program for new crews of HIT-SCIR
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Meteorological Books
气象相关书籍合集(持续更新)
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
Dive Into Machine Learning
Dive into Machine Learning with Python Jupyter notebook and scikit-learn! First posted in 2016, maintained as of 2021. Pull requests welcome.
Stars: ✭ 10,810 (+8479.37%)
Mutual labels:  jupyter-notebook
Examples
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Deep Auto Punctuation
a pytorch implementation of auto-punctuation learned character by character
Stars: ✭ 125 (-0.79%)
Mutual labels:  jupyter-notebook
The Data Science Workshop
A New, Interactive Approach to Learning Data Science
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Nlpmetrics
Python code for various NLP metrics
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Simplestockanalysispython
Stock Analysis Tutorial in Python
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook
Cmucomputationalphotography
Jupyter Notebooks for CMU Computational Photography Course 15.463
Stars: ✭ 126 (+0%)
Mutual labels:  jupyter-notebook

L4 Stepsize Adaptation Scheme

By Michal Rolínek, Georg Martius.

Autonomous Learning Group, Max Planck Institute for Intelligent Systems.

Table of Contents

  1. Introduction
  2. Requirements
  3. Installation
  4. Usage
  5. Notes

Introduction

This repository contains TensorFlow implementation code for the paper "L4: Practical loss-based stepsize adaptation for deep learning". This work proposes an explicit rule for stepsize adaptation on top of existing optimizers such as Adam or momentum SGD.

Disclaimer: This code is a PROTOTYPE and most likely contains bugs. It should work with most Tensorflow models but most likely it doesn't comply with TensorFlow production code standards. Use at your own risk.

Requirements

TensorFlow >= 1.4.

For a PyTorch implementation of L4, see l4-pytorch (also linked here as a submodule).

Installation

Either use one of the following python pip commands,

python -m pip install git+https://github.com/martius-lab/l4-optimizer
python3 -m pip install git+https://github.com/martius-lab/l4-optimizer

or simply drop the L4/L4.py file to your project directory

Usage

Exaclty as you would expect from a TensorFlow optimizer. Empirically, good values for the 'fraction' parameter are 0.1 < fraction < 0.3, where 0.15 is set default and should work well enough in most cases. Decreasing 'fraction' is typically a good idea in case of a small batch size or more generally for very little signal in the gradients. Too high values of 'fraction' behave similarly to too high learning rates (i.e. divergence or very early plateauing).

import L4

...
opt = L4.L4Adam(fraction=0.20)
opt.minimize(loss)
...

or

import L4

...
opt = L4.L4Mom()  # default value fraction=0.15 is used
grads_and_vars = opt.compute_gradients(loss)
...
# Gradient manipulation
...

opt.apply_gradients(grads_and_vars) # (!) Passing the loss is no longer needed (!)
...

Notes

Contribute: If you spot a bug or some incompatibility, contribute via a pull request! Thank you!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].