
tensorflow
43118
JonyChan技术学习过程中的总结
展开
-
tf.reduce_sum与torch.sum
dim 参数对应的维数消失this_platf_target_outputs = torch.reshape(this_platf_target_outputs, shape=(self.batch_size, self.seq_len, self.num_nodes, self.units)) # (64, 6, 30, 16)this_platf_target_outputs = torch.sum(this_platf_target_outputs, dim=2) # shape=(ba.原创 2021-05-26 14:44:29 · 6311 阅读 · 0 评论 -
矩阵乘法:tf.multiply与tf.matmul
tf.multiply : 按元素相乘 # [64*6*30, 2] * [64*6*30,1]this_platf_target_outputs = tf.multiply(neighbor_part_inputs, mask[target_node, platf, ...])Returns x * y element-wisetf.matmul: 矩阵相乘this_platf_target_outputs = tf.matmul(this_platf_target_outputs.原创 2021-05-26 14:15:03 · 291 阅读 · 0 评论 -
tensorflow的[...]表示
mask: # (30,3,64630,1)# mask[target_node,platf,...] : ... 将后面的维数拉平# [64*6*30, 2] * [64*6*30,1]this_platf_target_outputs = tf.multiply(neighbor_part_inputs, mask[target_node,platf,...])原创 2021-05-26 11:55:41 · 118 阅读 · 0 评论