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

  • 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')
])
主站蜘蛛池模板: 微博| 东兴市| 营山县| 黄山市| 宁夏| 阆中市| 宜都市| 荆门市| 商河县| 安远县| 黎平县| 洛南县| 娄烦县| 屯留县| 新和县| 淮南市| 丰台区| 大荔县| 彰化市| 沛县| 泾川县| 安多县| 佛山市| 磐石市| 合山市| 屏东县| 安义县| 柳州市| 永兴县| 娱乐| 绥滨县| 浦县| 新宁县| 剑川县| 中卫市| 仁怀市| 黎川县| 山阴县| 黑河市| 咸丰县| 囊谦县|