def mul(self, z):
v = tf.expand_dims(self.v, 1) # [num_units, 1]
vstar = tf.conj(v) # [num_units, 1]
vstar_z = tf.matmul(z, vstar) #[batch_size, 1]
sq_norm = tf.reduce_sum(tf.abs(self.v)**2) # [1]
factor = (2 / tf.complex(sq_norm, 0.0))
return z - factor * tf.matmul(vstar_z, tf.transpose(v))
# Permutation unitary matrix
评论列表
文章目录