Comments (7)
This is the initial version of implementation of VFL and I forgot to refine it.
alpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
actually equals to alpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
, because there is a multiplier (target <= 0.0).float()
in that formula and the target is always >= 0.
from varifocalnet.
This is the initial version of implementation of VFL and I forgot to refine it.
alpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
actually equals toalpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
, because there is a multiplier(target <= 0.0).float()
in that formula and the target is always >= 0.
You means alpha * pred_sigmoid.abs().pow(gamma) * (target <= 0.0).float()
equals alpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
or alpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
equals to alpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
? I'd understand the situation if it is the former one.
According to paper, the negtive weight should be alpha * pred_sigmoid.abs().pow(gamma) * (target <= 0.0).float()
.Is the formular of paper current version?
from varifocalnet.
Hi, target
is the IoU so it is always >= 0, which implies target <= 0
<=> target == 0
.
In this way,
alpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
<=>
alpha * (pred_sigmoid - target).abs().pow(gamma) * (target == 0.0).float()
<=>
alpha * pred_sigmoid.abs().pow(gamma) * (target == 0.0).float()
.
from varifocalnet.
Ohhh! Thanks, I understand it now.
from varifocalnet.
Hi @hyz-xmaster ,
- I did not find the
q
in the red circle according to the code. - I can't understand the item above the green line. Since
log(1-p)
is used to predict negative samples, why it appears in theq>0
case? And anyway, I did not find the related implementation from the code. I just understand the code by the following way:
Looking forward to your reply, thanks.
from varifocalnet.
Hi @feiyuhuahuo,
target
in the code representsq
in that formula.qlog(p)+(1-q)log(1-p)
is the binary cross entropy loss, which is calculated by F.binary_cross_entropy_with_logits. Whenq = 0
,qlog(p)+(1-q)log(1-p)
reduces tolog(1-p)
. Whenq > 0
, it keeps unchanged.
from varifocalnet.
This is the initial version of implementation of VFL and I forgot to refine it.
alpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
actually equals toalpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
, because there is a multiplier(target <= 0.0).float()
in that formula and the target is always >= 0.You means
alpha * pred_sigmoid.abs().pow(gamma) * (target <= 0.0).float()
equalsalpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
oralpha * (pred_sigmoid - target).abs().pow(gamma) * (target <= 0.0).float()
equals toalpha * pred_sigmoid.pow(gamma) * (target == 0.0).float()
? I'd understand the situation if it is the former one.According to paper, the negtive weight should be
alpha * pred_sigmoid.abs().pow(gamma) * (target <= 0.0).float()
.Is the formular of paper current version?
Hello, did you add your loss to yolov5? Judge which place needs to be adjusted?
from varifocalnet.
Related Issues (20)
- Some question about the inference HOT 4
- VFNet-X's config file 404 error HOT 2
- VFocalLoss in yolov5 HOT 3
- Do you think the `VarifocalLoss` could be used for labels with value of 0 & 1 ? HOT 2
- How to visualize detection results?
- where is Star-Shaped Box Feature Representation and Bounding Box Refinement in the code HOT 2
- GPU error HOT 3
- KeyError: 'ATSSVGFLHead is not in the head registry' HOT 9
- How to reimplement IACS? HOT 2
- Varifocal Loss for YOLOv5 HOT 2
- Using MMDet version of VFNet with the lastest backbone (e,g. Poolformer S36, ConvNeXt Small) with Inf Issues on Varifocal loss HOT 1
- VarifocalLoss HOT 1
- Can varifocal loss be applied to softmax classifier?
- AttributeError:'ConfigDict' object has no attribute 'test_cfg'
- Question about `detach` HOT 7
- About applying Varfifocal to yolox objectness loss HOT 2
- cls loss is increasing HOT 4
- Train custom dataset HOT 2
- Welcome update to OpenMMLab 2.0
- Architecture dimension
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 varifocalnet.