了解层和激活函数在Keras神经网络中的作用

问题描述 投票:0回答:2

(28, activation="relu")函数的作用,mnist数据集在神经网络中的Dropoutsoftmax在整个代码中需要每一层的正确指导

model = tf.keras.models.Sequential([
      tf.keras.layers.Flatten(input_shape=(28, 28)),
      tf.keras.layers.Dense(128, activation='relu'),
      tf.keras.layers.Dropout(0.2),
      tf.keras.layers.Dense(10, activation='softmax')
    ])
python tensorflow keras neural-network mnist
2个回答
1
投票

数字128,10是网络每一层中神经元的数量。 tf.Dense()用于创建图层。


0
投票
[我建议阅读Keras的documentation。函数及其参数的作用在此处得到了很好的解释。
© www.soinside.com 2019 - 2024. All rights reserved.