This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# workaround to fix opimizer bug in tensorflow | |
optimizer = tf.keras.optimizers.Adam( | |
learning_rate=tf.Variable(0.001), | |
beta_1=tf.Variable(0.9), | |
beta_2=tf.Variable(0.999), | |
epsilon=tf.Variable(1e-7), | |
) | |
optimizer.iterations # this access will invoke optimizer._iterations method and create optimizer.iter attribute | |
optimizer.decay = tf.Variable(0.0) # Adam.__init__ assumes ``decay`` is a float object, so this needs to be converted to tf.Variable **after** __init__ method. |