标签: tensorflow
根据此文档https://www.tensorflow.org/api_docs/python/tf/nn/l2_loss,它说
Defined in tensorflow/python/ops/gen_nn_ops.py.
但是当我去tensorflow / python / ops / gen_nn_ops.py时,没有定义l2_loss。
我试图了解使用tf.nn.l2_loss(W)或仅使用tf.reduce_sum(tf.square(W))之间的区别。
tf.nn.l2_loss(W)
tf.reduce_sum(tf.square(W))
答案 0 :(得分:1)
Here是它使用的CPU实现。
Here是相应的渐变实现。