• Stars
    star
    159
  • Rank 234,568 (Top 5 %)
  • Language
    Python
  • Created about 6 years ago
  • Updated over 5 years ago

Reviews

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

Repository Details

mutil-class focal loss implemented in keras

Focal loss

Usage

  • firstly, you should get a list which contains each class number, like classes_nu=[1,2,3] means index_0 class have 1 pic, index_1 class have 1 pics, index_2 class have 3 pics.
  • then, use the focal loss function like below:

model.compile(optimizer=SGD(lr=learning_rate, momentum=0.9), loss=[focal_loss(classes_num)], metrics=['accuracy'])

blog of focal loss