-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semi-hard negative bug? #48
Comments
Hi @melgor - thanks for reporting this! I've updated the code to your second suggestion and added some output info about how many random Interestingly the conditions with I tested this for later iterations with the I've been training a new model with suggestion 1 over the past few days, interested to see how much this improves the accuracy. -Brandon. |
Re-opening, I'm having some strange accuracy issues with this. @melgor - have you successfully trained a model with your Suggestion 2? In the following, I switched from your Suggestion 1 to suggestion 2 at about iteration 45. I don't yet understand why suggestion 2 causes such bad performance. Any ideas? Since suggestion 1's model was starting to perform better, I've made this the default version for now. Iter 40
Latest Iter
|
It it really strange. I have one idea why it may work so bad, but still it About my tests, I do not have 12 GB on my card, so I only test 2-step I think that you should stay at Suggestion 1, it may be better is some 9:58 PM pon., 09.11.2015 Brandon Amos użytkownik notifications@github.com
|
@melgor - suggestion 1 is working well so far. Averaging ~300 random triplets out of 1000 in the offline sampling and almost at the previous net's accuracy. Epoch 55Epoch 54 |
@bamos
I recently read the semi-hard negative code. I am not sure, but I think it may not work as assumed.
I am talking about that fragment from traininig/train.lua
The main concert is connected with
negDist < alpha
Alpha is set to 0.2 and negDist would be never lower than that (and in the same time bigger than posDist), I think that condition is wrong.
I make a quick test and never this condition was satisfied.
Suggestion 1
I think, that based on TripletLoss, the condition should looks like that:
It choose that negative example which distance is higher than from positive one, but in other hand, no further than alpha.
Suggestion 2
But, after some test, I think that this condition should be better. Sometimes for person no negative example satisfy the conditions, then it is chosen the random negative example. I am proposing sth like that:
It take negative example, which are better than previous one and additionally break when "alpha" condition is satisfied. I think that we do not need to have best negative example, which satisfy condition (this is similar way to Oxford-Face algorithm for Triplet selection). Additional, it will speed up all process.
But first of all, am I right claiming that current semi-hard negative condition does not work as should and now it choose only random negative example?
The text was updated successfully, but these errors were encountered: