Reputation: 2226
I have written a python script which calculates the median frequency balancing weights for each class during the pixel-wise segmentation. Then, I added a Python Layer
to the caffe
model definition, which sends the weights to the loss function. Based on this link, user mentions that SoftmaxWithLoss
layer in caffe correspond to TensorFlow softmax_cross_entropy_with_logits
.
My question is how can I send the weights to SoftmaxWithLoss layer?
What other Loss layers can be used with median frequency balancing
? I used InfoGainLoss
, but it does not converge. Your help is really appreciated.
Upvotes: 0
Views: 292
Reputation: 114896
If you want to weight the "SoftmaxLoss"
(i.e., cross entropy loss) according to classes then "InfogainLoss"
is what you need.
Note that infogain layer was upgraded in caffe a few months ago: it now integrates "Softmax"
into the loss computation for robust gradient estimation.
Upvotes: 0