Open luoyetx opened 6 years ago
@luoyetx you can remove if you prefer not to use ohem, or you can simply disable it in the configuration file. If you look at the code, ohem is first used to compute a softmax loss, which the probabilities of the classes are then fed into the detection module to sort labels out, hence online hard example mining. Hope I got the concept correct!
When I read the implementation, I got the same question with @luoyetx. During my own understanding, It seems that we can simplify OHEM branches.
The function of ohem is online negative and positive mining
In anchor_target_layer.py, in# Subsample positives
and# Subsample negatives
section, you can see its effect.
Of course, I think this is just one way of implementing OHEM, and there must be other ways
We only need the scores to sort the training samples, the branches added in doesn't backpropagate the gradients, which I think can be removed. I run the experiments and get the same result.
the
ohem
layers inm1@ssh_ohem
shares weight withm1@ssh
and only provide scores foranchor_target_layer
, can we remove these layers and use scores fromm1@ssh
. It seems the same.