Tensorflow2.0 全连接层全连接层的基本使用使用函数创建全连接网络
全连接层的基本使用""" 全连接层 -- 简单使用"""import tensorflow as tf# 输入维度[4, 784]x = tf.random.normal((4, 784))# 网络结构 [?, 512] 输入维度确定?net = tf.keras.layers.Dense(units=512)out = net(x)print("输出维度:", out.shape)# 根据矩阵相乘规则 推断出