Comments (9)
I was not clear. By "iteration", I mean the iteration of the outer for-loop in the code I posted.
Since the counters were not reset between these iterations, each image in a batch ends up using a different beta
, which is neither the neg/pos ratio within a batch, nor a neg/pos ratio within an image.
from hed.
The accumulation iters through all spatial locations in one SINGLE image. The counter resets everytime the forward function is called. The balancing factor we used is not precomputed across the whole dataset (for which it could be), but on a single image instead.
from hed.
Oooops. Thanks for the heads-up. You are correct. This is a bug. Luckily it doesn't affect the results: because it is in the forward loop only for "showing" the loss. And the (wrongly) computed balancing factor, should still be around 0.05vs0.95, similar to what is computed globally, or on a single image.
The crucial backward computation is correct.
Thanks again for noticing this... I'll correct it right away.
from hed.
quick question on the backward computation: on line 107:
bottom_diff[i * dim + j] *= 1 * count_neg / (count_pos + count_neg);
and line 110
bottom_diff[i * dim + j] *= count_pos / (count_pos + count_neg);
why there is an extra "1" in line 107? It looked like doesn't make any differences between these two lines while only bottom_diff is weighted based on the count of labels?
from hed.
Yes. You can remove the "1" and it's obviously equivalent.
from hed.
Hi, the modified SigmoidCrossEntropy Loss layer has a line
that reads like -:
bottom_diff[i * dim + j] *= 1 * count_neg / (count_pos + count_neg);
It seems that the gradients are multiplied every iteration in the loops. It is a little confusing to me. Why there is a '*' ahead of the '=' ?
from hed.
That's back propagation.
from hed.
@ppwwyyxx
The loss may be something like:
So you mean the gradients calculation is automatically done by caffe, here in the code , the author is just multiplying the gradients by the weight factor?
from hed.
It's done in the code. https://github.com/s9xie/hed/blob/master/src/caffe/layers/sigmoid_cross_entropy_loss_layer.cpp#L89
from hed.
Related Issues (20)
- ImportError: dynamic module does not define module export function (PyInit__caffe) HOT 1
- Batch Processing with HED without MATLAB
- Trouble with PostprocessHED.m parameters
- tenosrflow version
- link error undefined symbols for x86_64
- how to test it with RGBD data?
- Is this a memory leak? (python)
- How to get all the (X, Y) values of the edge for one object?
- train error
- Looking for BSDS500 test images computed by pretrained hed model
- NYUDv2 pretrainModel
- Can the parameters of the function edgeNmsMex be modified?
- 为什么,预测出来的边框比较宽? HOT 6
- requirement.txt file HOT 1
- Other datasets
- The preprocess of the dataset? HOT 1
- The augmented BSDS data (1.2GB), HOT 3
- The test output image and the input image are not aligned, and there are crops on the top and left HOT 1
- where is Yfuse implemented in code?
- questions about BN layer
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 hed.