Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

Rectified Nadam implemented in Keras

Project description

Keras RNAdam

use of nesterov accelerated geadient instead of momentum in rectified-adam

Install

pip install keras_rnadam

Usage

import keras
import numpy as np
from keras_rnadam import RNAdam

# Build toy model with RNAdam optimizer
model = keras.models.Sequential()
model.add(keras.layers.Dense(input_shape=(17,), units=3))
model.compile(RNAdam(), 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_nradam import RNAdam
RNAdam(total_step=10000, warmup_proportion=0.1, min_lr=1e-5)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for keras-rnadam, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size keras_rnadam-0.2.0.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page