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

Functional API

This is just another layout for coding the model graph. You can choose the following layout if you are more comfortable with Python style code writing:

from keras.models import Model
from keras.layers import Dense, Input

#defining input placeholder with input shape
inp = Input(shape = 100)

# layers
x = Dense(units = 128, activation = 'relu')
x = Dense(units = 64, activation = 'relu')

# taking output
predict = Dense(units = 4, activation = 'softmax')(x)

# defining model
model = Model(inputs = inp, outputs = predict)
主站蜘蛛池模板: 梓潼县| 宣汉县| 徐闻县| 阿合奇县| 沾化县| 银川市| 吐鲁番市| 张家川| 拉孜县| 襄垣县| 凤凰县| 榕江县| 万盛区| 潼关县| 揭东县| 溆浦县| 徐州市| 区。| 千阳县| 洪泽县| 凭祥市| 花莲县| 昔阳县| 正定县| 江都市| 淮北市| 分宜县| 光山县| 永州市| 永登县| 浮山县| 乐山市| 沾化县| 北川| 宁河县| 碌曲县| 商洛市| 烟台市| 曲水县| 德安县| 错那县|