What is regularization loss in tensorflow?

前端 未结 1 997
清酒与你
清酒与你 2021-02-18 23:28

When training an Object Detection DNN with Tensorflows Object Detection API it\'s Visualization Plattform Tensorboard plots a scalar named regularization_loss_1

相关标签:
1条回答
  • 2021-02-19 00:12

    TL;DR: it's just the additional loss generated by the regularization function. Add that to the network's loss and optimize over the sum of the two.

    As you correctly state, regularization methods are used to help an optimization method to generalize better. A way to obtain this is to add a regularization term to the loss function. This term is a generic function, which modifies the "global" loss (as in, the sum of the network loss and the regularization loss) in order to drive the optimization algorithm in desired directions.

    Let's say, for example, that for whatever reason I want to encourage solutions to the optimization that have weights as close to zero as possible. One approach, then, is to add to the loss produced by the network, a function of the network weights (for example, a scaled-down sum of all the absolute values of the weights). Since the optimization algorithm minimizes the global loss, my regularization term (which is high when the weights are far from zero) will push the optimization towards solutions tht have weights close to zero.

    0 讨论(0)
提交回复
热议问题