资源算法YellowFin_Keras

YellowFin_Keras

2020-02-20 | |  39 |   0 |   0

YellowFin for keras!

I made some modifications to the TensorFlow implementation of the YellowFin optimizer introduced by Jian Zhang, Ioannis Mitliagkas, and Christopher Ré in the paper YellowFin and the Art of Momentum Tuning.

My notes on the YellowFin paper and this script are here on my website. Additional test examples coming soon

The YellowFin version here can now be used in keras through the TFOptimizer() function. For example:

from yellowfin import YFOptimizerfrom keras.optimizers import TFOptimizer# define your optimizeropt = TFOptimizer(YFOptimizer())# compile a classification modelmodel.compile(loss = 'categorical_crossentropy',               metrics = ['acc'],               optimizer = opt)

The changes I made to the TensorFlow version of YellowFin allow the TFOptimizer() class from keras to directly call the compute_gradients() and apply_gradients() methods necessary to compile the model object. This could be significantly improved by making a native keras optimizer that inherits directly from the keras.optimizers.Optimizer class rather than hacking together some TensorFlow compatibility.

There's currently an example using the CIFAR10 CNN from the keras examples. I've tested this optimizer on Ubuntu 16.04 with both CPU and GPU.


上一篇:YellowFin_MXNet

下一篇:Python-Yellowfin

用户评价
全部评价

热门资源

  • seetafaceJNI

    项目介绍 基于中科院seetaface2进行封装的JAVA...

  • spark-corenlp

    This package wraps Stanford CoreNLP annotators ...

  • Keras-ResNeXt

    Keras ResNeXt Implementation of ResNeXt models...

  • capsnet-with-caps...

    CapsNet with capsule-wise convolution Project ...

  • shih-styletransfer

    shih-styletransfer Code from Style Transfer ...