1
ich den folgenden Code versuchtTensorflow - tf.matmul von konv Funktionen und ein Vektor als Batch matmul
batch_size= 128
c1 = tf.zeros([128,32,32,16])
c2 = tf.zeros([128,32,32,16])
c3 = tf.zeros([128,32,32,16])
c = tf.stack([c1, c2, c3], 4) (size: [128, 32, 32, 16, 3])
alpha = tf.zeros([128,3,1])
M = tf.matmul(c,alpha)
Und es macht Fehler bei tf.matmul
.
Was ich will, ist nur eine lineare Kombination alpha[0]*c1 + alpha[1]*c2 + alpha[2]*c3
bei jeder Probe. Wenn die Stapelgröße 1 ist, ist dieser Code in Ordnung, aber wenn nicht, wie kann ich es tun?
Sollte ich c1,c2,c3
umformen?