RAdam implemented in Keras
Project description
Keras RAdam
Unofficial implementation of RAdam.
Install
pip install keras-rectified-adam
Usage
import keras
import numpy as np
from keras_radam import RAdam
# Build toy model with RAdam optimizer
model = keras.models.Sequential()
model.add(keras.layers.Dense(input_shape=(17,), units=3))
model.compile(RAdam(), loss='mse')
# Generate toy data
x = np.random.standard_normal((4096 * 30, 17))
w = np.random.standard_normal((17, 3))
y = np.dot(x, w)
# Fit
model.fit(x, y, epochs=5)
Use Warmup
from keras_radam import RAdam
RAdam(total_step=10000, warmup_proportion=0.1, min_lr=1e-5)
Q & A
About Correctness
The optimizer produces similar losses and weights to the official optimizer after 500 steps.
Use tf.keras or tf-2.0
Add TF_KERAS=1 to environment variables to use tensorflow.python.keras.
Use theano Backend
Add KERAS_BACKEND=theano to environment variables to enable theano backend.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file keras-rectified-adam-0.2.0.tar.gz.
File metadata
- Download URL: keras-rectified-adam-0.2.0.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
21160667ce66e41719d57bd8b1b436151b517369a7ecf6147bf4ef3e70fb242f
|
|
| MD5 |
b9ccacea96a812a4aaa6cee9b4d843f9
|
|
| BLAKE2b-256 |
094968853275497bd8e52316b4a27f75b1706cfe052b24897b9086d886732818
|