Skip to content
This repository was archived by the owner on Jun 24, 2021. It is now read-only.
/ keras-lookahead Public archive

Lookahead mechanism for optimizers in Keras.

License

Notifications You must be signed in to change notification settings

CyberZHG/keras-lookahead

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7a44ca4 · Jun 24, 2021

History

17 Commits
Sep 11, 2019
Jun 24, 2021
Sep 23, 2019
Sep 11, 2019
Jun 24, 2021
Sep 11, 2019
Sep 11, 2019
Sep 11, 2019
Jun 24, 2021
Jun 24, 2021
Jun 24, 2021
Sep 23, 2019
Sep 11, 2019

Repository files navigation

Keras Lookahead

Travis Coverage

This repo is outdated and will no longer be maintained.

Unofficial implementation of the lookahead mechanism for optimizers.

Install

pip install git+https://github.com/cyberzhg/keras-lookahead.git

External Links

Usage

Arguments:

  • optimizer: Original optimizer.
  • sync_period: the k in the paper. The synchronization period.
  • slow_step: the α in the paper. The step size of slow weights.
from keras_lookahead import Lookahead

optimizer = Lookahead('adam', sync_period=5, slow_step=0.5)

Custom optimizers can also be used:

from keras_radam import RAdam
from keras_lookahead import Lookahead

optimizer = Lookahead(RAdam())