import tensorflow as tf

构建卷积神经网络

model = tf.keras.models.Sequential([ tf.keras.layers.Conv2D(64, (5, 5), activation='relu', input_shape=(28, 28, 1)), tf.keras.layers.MaxPooling2D((2, 2)), tf.keras.layers.Flatten(), tf.keras.layers.Dense(128, activation='relu'), tf.keras.layers.Dense(10, activation='softmax') ])

打印模型结构

model.summary()

填写 python 代码在 Begin-End 段中构建出如下结构的卷积神经网络:64 个 55 的卷积核组成的卷积层激活函数为 relu;最大池化层池化核大小为 22;扁平;128 个神经元的全连接层激活函数为 relu;10 个神经元的全连接层激活函数为 softmax。

原文地址: https://www.cveoy.top/t/topic/fqbK 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录