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

  • Mastering TensorFlow 1.x
  • Armando Fandango
  • 82字
  • 2021-06-25 22:51:03

Sequential API for creating the Keras model

In the sequential API, create the empty model with the following code:

model = Sequential()

You can now add the layers to this model, which we will see in the next section.

Alternatively, you can also pass all the layers as a list to the constructor. As an example, we add four layers by passing them to the constructor using the following code:

model = Sequential([ Dense(10, input_shape=(256,)), 
Activation(
'tanh'),
Dense(10
),
Activation(
'softmax')
])
主站蜘蛛池模板: 穆棱市| 通辽市| 新泰市| 凤凰县| 塔河县| 文成县| 黄大仙区| 习水县| 军事| 滨海县| 东源县| 神木县| 西城区| 台州市| 渑池县| 威远县| 开远市| 黑山县| 宜春市| 登封市| 新昌县| 襄汾县| 锡林浩特市| 芦溪县| 连城县| 北票市| 奎屯市| 山丹县| 龙山县| 临海市| 新疆| 华宁县| 比如县| 南丰县| 台中县| 黔江区| 绥化市| 广南县| 辽中县| 镇巴县| 武川县|