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.
Asked
Active
Viewed 278 times
0

S.EB
- 1,966
- 4
- 29
- 54
1 Answers
0
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.

Shai
- 111,146
- 38
- 238
- 371
-
Thanks for your comment, I applied `InfoGainLoss`, however, it is over-segmenting. I do not know what is the reason. My other question is that "`Softmax`" does not have any parameter that I can feed the weights by using that, could I to explain more? Thanks – S.EB Jan 23 '18 at 07:50