This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import caffe | |
import numpy as np | |
import json | |
class FocalLoss(caffe.Layer): | |
""" | |
Compute Focal Loss | |
Inspired by https://arxiv.org/abs/1708.02002 | |
Raul Gomez Bruballa | |
https://gombru.github.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import caffe | |
import numpy as np | |
class CustomSoftmaxLoss(caffe.Layer): | |
""" | |
Compute Cross Entropy loss with Softmax activations for multi-label classifications, accepting real numbers as labels | |
Inspired by https://arxiv.org/abs/1805.00932 | |
Raul Gomez Bruballa | |
https://gombru.github.io/ | |
""" |