官术网_书友最值得收藏!

  • Keras Deep Learning Cookbook
  • Rajdeep Dua Manpreet Singh Ghotra
  • 162字
  • 2021-06-10 19:38:47

Using the Theano backend with Keras

  1. Let's modify the default configuration and change TensorFlow to Theano as the backend of Keras. Modify the keras.json file:
vi .keras/keras.json

The default file has the following content:

{ "image_data_format": "channels_last", 
"
epsilon": 1e-07,
"
floatx": "float32",
"
backend": "tensorflow"
}
  1. The modified file will look like the following file. The "backend" value has been changed to "theano":
{ "image_data_format": "channels_last", 
"
epsilon": 1e-07,
"
floatx": "float32",
"
backend": "theano"
}
  1. Run the Python console and import Sequential from keras.model using the Theano backend:
$ python
Python 2.7.14 |Anaconda, Inc.| (default, Oct 16 2017, 17:29:19)
[GCC 7.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keras.models import Sequential

Notice how the backend has changed to Theano.

We have installed miniconda, all the dependencies of TensorFlow, and Theano. This was followed by installing TensorFlow and Theano itself. Finally, we installed Keras. We also learned how to change the backend of Keras from TensorFlow to Theano.

主站蜘蛛池模板: 开阳县| 英吉沙县| 新安县| 宁城县| 化德县| 安乡县| 水城县| 林芝县| 宜州市| 开江县| 临高县| 新余市| 松原市| 玉龙| 安陆市| 富蕴县| 福建省| 中西区| 抚顺县| 白银市| 中山市| 卢湾区| 平塘县| 铁岭市| 潍坊市| 海丰县| 从化市| 铜梁县| 遵化市| 辉南县| 镇原县| 南郑县| 德江县| 白玉县| 永嘉县| 阜南县| 昌吉市| 长岭县| 永康市| 太原市| 淮阳县|