Python tesorflow.tensordot()背后的数学
我一直在努力理解tensorflow.tensordot()背后的数学,主要是轴参数。我试过一些代码 我的代码Python tesorflow.tensordot()背后的数学,python,tensorflow2.0,tensordot,Python,Tensorflow2.0,Tensordot,我一直在努力理解tensorflow.tensordot()背后的数学,主要是轴参数。我试过一些代码 我的代码 A = tf.constant([[32, 83, 5], [17, 23, 10], [75, 39, 52]]) B = tf.constant([[28, 57, 20], [91, 10, 95], [37, 13, 45]]) dot_AB = tf.tensordot(A
A = tf.constant([[32, 83, 5],
[17, 23, 10],
[75, 39, 52]])
B = tf.constant([[28, 57, 20],
[91, 10, 95],
[37, 13, 45]])
dot_AB = tf.tensordot(A, B, axes = 1)
print(f'Dot product is \n {dot_AB.numpy()}')
输出
Dot product is
[[8634 2719 8750]
[2939 1329 2975]
[7573 5341 7545]]
我已经经历过了,但这是徒劳的
谁能详细解释一下它背后的数学原理,从1D矩阵到3/4D矩阵。我知道输出形状。我想知道,我如何手动计算它?请在轴上也显示一些灯光
如能提供具有不同矩阵尺寸和不同轴值的详细示例,将不胜感激