问题
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