我想用tf.nn.conv2d()
来做完全连接层。然而,我的结果并不完全正确。我不知道这是否是一个填充问题
a = tf.constant([1.0,2.0],shape=[1,1,2,1])
b = tf.constant([1.0,2.0,3.0,4.0],shape=[2,2,1,1])
c = tf.nn.conv2d(a,b,strides=[1,1,1,1],padding='SAME')
with tf.Session() as sess:
result = sess.run(c)
mat_b = sess.run(b)
print(mat_b)
print(result)
a = np.array([1.0,2.0])
b = np.array([[1.0,3.0],[2.0,4.0]])
c = np.matmul(a,b)
print(c)
我期望我的结果是[5,11]
,然而,我的实际结果是[5,2]
。在我的体重右角值不起作用
有没有办法用conv2d
来做完全连接层
目前没有回答
相关问题 更多 >
编程相关推荐