Keras安装 {Keras 由浅入深}
Keras 安装
|
![tensorflow ](https://img-blog.csdnimg.cn/20190825125400589.png#==#pic_center =40x)TensorFlow|
python & mathematics
installation
sudo pip install keras
backend : tensorflow
dependencies:
cuDNN (recommended if you plan on running Keras on GPU).
HDF5 and h5py (required if you plan on saving Keras models to disk).
graphviz and pydot (used by visualization utilities to plot model graphs).
其实用tensorflow是可以的
我也比较推荐直接使用tensorflow
因为keras其实是tensorflow的高阶API
用tensorflow能够使得传统的keras程序有较好的扩展性。
不仅能够使用keras中的特性也能受益于tensorflow
import tensorflow as tf from tensorflow import keras from tensorflow.keras import layouts def build_model(): model = keras.Sequential([ layers.Dense(64, activation=tf.nn.relu, input_shape=[len(train_dataset.keys())]), layers.Dense(64, activation=tf.nn.relu), layers.Dense(1) ]) optimizer = tf.keras.optimizers.RMSprop(0.001) model.compile(loss=‘mean_squared_error‘, optimizer=optimizer, metrics=[‘mean_absolute_error‘, ‘mean_squared_error‘]) return model
相关推荐
GDGYZL 2020-08-28
comwayLi 2020-08-16
Niteowl 2020-07-15
lybbb 2020-05-05
xiaoxiaokeke 2020-11-04
KyrieHe 2020-10-04
davidsmith 2020-09-04
xiaoxiaokeke 2020-08-04
xiaoxiaokeke 2020-07-28
诗蕊 2020-07-20
dataastron 2020-07-18
zhongkeli 2020-07-14
xiaoxiaokeke 2020-06-27
xiaoxiaokeke 2020-06-25
CodeWang 2020-06-21
xiaoxiaokeke 2020-06-16
zhongkeli 2020-06-14
lujiandong 2020-06-14