- Python Deep Learning
- Ivan Vasilev Daniel Slater Gianmario Spacagna Peter Roelants Valentino Zocca
- 119字
- 2021-07-02 14:31:09
Keras
Keras is a high-level neural net Python library that runs on top of TensorFlow, CNTK (https://github.com/Microsoft/CNTK), or Theano. For the purposes of this book, we'll assume that it uses TensorFlow on the backend. With Keras, you can perform rapid experimentation and it's relatively easy to use compared to TF. It will automatically detect an available GPU and attempt to use it. Otherwise, it will revert to the CPU. If you wish to specify the device manually, you can import TensorFlow and use the same code as in the previous section, TensorFlow:
with tensorflow.device("/gpu:1"):
# Keras model definition here
Once again, you can refer to the online documentation for further information at http://keras.io.