January 2019
Intermediate to advanced
386 pages
11h 13m
English
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.