import tensorflow as tf
from tensorflow import keras
x = tf.random.normal([2, 3])#要喂进去的数值#两个列子,每个例子的维度是3
model = keras.Sequential([
#全连接层
keras.layers.Dense(2, activation='relu'),#dense为输入的维度
keras.layers.Dense(2, activation='relu'),
keras.layers.Dense(2)
])
model.build(input_shape=[None, 3])
#查看网络结构
model.summary()
for p in model.trainable_variables:
print(p.name, p.shape)
tensorflow2.0基本操作,全连接层
最新推荐文章于 2022-08-13 23:20:45 发布
关键词由CSDN通过智能技术生成