我试图将以下 MATLAB 代码转换为 tensorflow :
WW = sum(W.^2, 1); % ( 1 x D^(l)= sum( (D^(l-1) x D^(l)), 1 )
XX = sum(A.^2, 2); % (M x 1) = sum( (M x D^(l-1)), 2 )
bsxfun(@plus, WW, XX) ; % (M x D^(l)) - (M x D^(l)) = (M x D^(l-1)) * (D^(l-1) x D^(l)) - (M x D^(l))
这是非常简单的 MATLAB 代码,我想知道 TensorFlow 中是否有等效的代码。理想情况下,W
和/或 X
应该是 tf.Variable(init)
变量,因为我想计算每个变量的导数变量。
最佳答案
关于machine-learning - TensorFlow 中是否有与 Matlab 中等效的 bsxfun ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37904504/