Skip to content

Instantly share code, notes, and snippets.

@ypwhs
Last active October 8, 2019 09:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ypwhs/c54dc9031a408a31c71fa513c2da9945 to your computer and use it in GitHub Desktop.
Save ypwhs/c54dc9031a408a31c71fa513c2da9945 to your computer and use it in GitHub Desktop.
Keras 固定随机数种子重现相同的训练结果
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yylonly
Copy link

yylonly commented May 15, 2018

我在google colab无法重现 你tf和keras版本是?

Train on 60000 samples, validate on 10000 samples
Epoch 1/2
60000/60000 [==============================] - 4s 61us/step - loss: 0.2117 - acc: 0.9365 - val_loss: 0.1123 - val_acc: 0.9645
Epoch 2/2
60000/60000 [==============================] - 3s 54us/step - loss: 0.0834 - acc: 0.9755 - val_loss: 0.0853 - val_acc: 0.9724
<keras.callbacks.History at 0x7f37e8751dd8>

Train on 60000 samples, validate on 10000 samples
Epoch 1/2
60000/60000 [==============================] - 4s 65us/step - loss: 0.2067 - acc: 0.9375 - val_loss: 0.1110 - val_acc: 0.9654
Epoch 2/2
60000/60000 [==============================] - 3s 53us/step - loss: 0.0805 - acc: 0.9759 - val_loss: 0.0831 - val_acc: 0.9735
<keras.callbacks.History at 0x7f37e87f2b38>

@ypwhs
Copy link
Author

ypwhs commented Apr 11, 2019

需要使用CPU运行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment