赞
踩
caffe的原始的loss的英文描述:
http://caffe.berkeleyvision.org/tutorial/loss.html
由于caffe支持的是有向无环图的网络结构。所以对于多个损失函数的网络结构也是绝对支持的,文中也说明了这一点:
Loss weights
For nets with multiple layers producing a loss (e.g., a network that both classifies the input using a SoftmaxWithLoss
layer and reconstructs it using a EuclideanLoss
layer), loss weights can be used to specify their relative importance.
此句话说明了这一点。但是此处也详细的说明了:loss_weight 参数的重要性,需要自己不断的实验调参数的。如果参数选取不好,就会导致结果不收敛,参数选取的好就会得到意想不到的结果。
最后也说明了最后输出的是多个损失函数的权重之和。如下:
The final loss in Caffe, then, is computed by summing the total weighted loss over the network, as in the following pseudo-code:
- loss := 0
- for layer in layers:
- for top, loss_weight in layer.tops, layer.loss_weights:
- loss += loss_weight * sum(top)
最后,再次感叹下:神经网络的神通广大,只要你想的到,哪怕上天入地,它就可以做的到,思维的灵感,神经的灵性!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。