Comments (1)
No the idea proposed in the paper is correct. It is the relative loss which matters. That is if it is a hard example(p<0.5) it should contribute more to the loss, and if it is a easy example(p>0.5) it should contribute less to the loss.
For example:
p=0.3 for hard example
p=0.7 for easy example
gamma=0.5
hard_loss=(1-p)=1-0.3=0.7 sqrt(0.7)=0.83
easy_loss=(1-p)=1-0.7=0.3 sqrt(0.3)=0.54
hard_loss>easy_loss
Another example:
p=0.3 for hard example
p=0.7 for easy example
gamma=2.0
hard_loss=(1-p)=1-0.3=0.7 sq(0.7)=0.49
easy_loss=(1-p)=1-0.7=0.3 sq(0.3)=0.09
hard_loss>easy_loss
Here gamma controls the relative difference between the losses. If the dataset set is highly skewed choose higher value of gamma.
(Check this out. This shows how different gamma values will impact loss during training)
In sequence tasks like OCR/OMR we have to distribute the p over many symbols, but the sum of probabilities remains 1 (sum(p)=1). Therefore we select lower gamma value(but greater than 0) as long as we maintain the relative loss.
Inshort, gamma(>0) controls the relative loss we want to impose on easy and hard samples.
if a>b
then a^n > b^n holds true
as long as n>0.
Image Source: Focal Loss for Dense Object Detection. (https://arxiv.org/pdf/1708.02002.pdf)
from focal-ctc-omr.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from focal-ctc-omr.