Slide 18
Slide 18 text
AI 18
Focal Lossの実装② - focal_loss_torch パッケージ
https://github.com/mathiaszinnen/focal_loss_torch/blob/0e9d9050b0c0e36fb8033c523ac8b2f0b44c00dd/focal_loss/focal_loss.py
ignore_indexを導入して
maskを導入
負の対数尤度(negative
log-likelihood)を計算
微小な値epsを足して
入力がゼロになることを避ける
ignore_indexを導入して
無視するmaskを追加
[Batch, Classes]のshapeを
[Batch x Classes]
[Batch, Classes]のshapeを
[Batch x Classes]
y=1だけを残す
多クラス分類に対応。特定のクラスの損失計算を無視する機能を追加。