Created
January 24, 2019 11:06
-
-
Save NoelKennedy/dff897272e234e8af1aa00886180075b to your computer and use it in GitHub Desktop.
How to configure keras - tensorflow for training using FP16
This file contains hidden or 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
import keras.backend as K | |
dtype='float16' | |
K.set_floatx(dtype) | |
# default is 1e-7 which is too small for float16. Without adjusting the epsilon, we will get NaN predictions because of divide by zero problems | |
K.set_epsilon(1e-4) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment