• Stars
    star
    141
  • Rank 259,971 (Top 6 %)
  • Language Protocol Buffer
  • Created over 7 years ago
  • Updated over 7 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Reproduction of Focal-loss on caffe

Reproduction of Focal-loss on Caffe

I didn't implement CPU version. If you want to see the details, please check focal_loss_layer.cu

To use Focal-Loss layer, you can:

  1. Directly compile my CaffeMex_v2 on Linux or Windows, the layer is already embedded.

  2. You can also add the three files, focal_loss_layer.cpp, focal_loss_layer.cu and focal_loss_layer.hpp, and modify caffe.proto in your own caffe.

An example in prototxt

Using it as the way you use cross entropy loss layer.

layer {
  name: "loss_focal"
  type: "FocalLoss"
  bottom: "predicted"
  bottom: "label"
  top: "loss_focal"
  loss_weight: 10
  loss_param{
    normalize: true
    normalization: FULL
  } 
}

Implementation for softmax form

Please refer to this repo