Skip to main content

AdaBound optimizer in Keras

Project description

Keras AdaBound

Travis Coverage

AdaBound optimizer in Keras.

Install

pip install keras-adabound

Usage

Use the optimizer

from keras_adabound import AdaBound

model.compile(optimizer=AdaBound(lr=1e-3, final_lr=0.1), loss=model_loss)

Load with custom objects

from keras_adabound import AdaBound

model = keras.models.load_model(model_path, custom_objects={'AdaBound': AdaBound})

About weight decay

The optimizer does not have an argument named weight_decay (as in the official repo) since it can be done by adding L2 regularizers to weights:

import keras

regularizer = keras.regularizers.l2(WEIGHT_DECAY / 2)
for layer in model.layers:
    for attr in ['kernel_regularizer', 'bias_regularizer']:
        if hasattr(layer, attr) and layer.trainable:
            setattr(layer, attr, regularizer)

Project details


Download files

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

Source Distribution

keras-adabound-0.6.0.tar.gz (5.5 kB view details)

Uploaded Source

File details

Details for the file keras-adabound-0.6.0.tar.gz.

File metadata

  • Download URL: keras-adabound-0.6.0.tar.gz
  • Upload date:
  • Size: 5.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

Hashes for keras-adabound-0.6.0.tar.gz
Algorithm Hash digest
SHA256 d9b62762600c9209765f71a4bd499c0aaea0b6dc3c536329bc947daf5764067e
MD5 59935a7e4353fee84655c2bc202890bb
BLAKE2b-256 bf7485de8379eba8e0f819ef9b62ff32d24a3f624758800e12bd9572e3afb546

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page