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

  • 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.

主站蜘蛛池模板: 临桂县| 固安县| 苏尼特右旗| 丹棱县| 湖州市| 霞浦县| 南丹县| 南郑县| 社会| 黔西| 兴安盟| 东海县| 宁南县| 卓尼县| 西藏| 中超| 宁南县| 漯河市| 靖安县| 鄂尔多斯市| 二连浩特市| 东宁县| 承德县| 财经| 玉门市| 章丘市| 四子王旗| 登封市| 平顺县| 拉孜县| 渑池县| 宣化县| 郴州市| 广丰县| 阜平县| 扶风县| 双辽市| 新津县| 克拉玛依市| 攀枝花市| 招远市|