Are there any hidden layers in the following model, or just Input and output layers?

試著忘記壹切 提交于 2021-01-01 09:19:20

问题


Are there any hidden layers in the following model, or just Input and output layers?

model = tf.keras.models.Sequential()
model.add(tf.keras.layers.Dense(1024, activation='relu', input_dim=1))
model.add(tf.keras.layers.Dense(1,))

回答1:


The first Dense layer is the hidden layer. Keras internally assigns an input layer for the model, with 1 input unit (the parameter of input_dim)




回答2:


there is one hidden dense layer with 1024 neuron and relu activation function.

can plot model with:

tf.keras.utils.plot_model(model, show_shapes=True)



来源:https://stackoverflow.com/questions/62300357/are-there-any-hidden-layers-in-the-following-model-or-just-input-and-output-lay

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!