Open ylqi007 opened 5 years ago
up。 Dose it works the same way as "# mask = tf.logical_and(mask, tf.greater(jaccard, matching_threshold))" ?
in the loss function: nmask = tf.logical_and(tf.logical_not(pmask), # nmask: negative mask gscores > -0.5) what "gscores > -0.5" means?
I think it's typo and should be 0.5, which is the ignore threshold.
@Fighting-JJ
For the first question, I don't think they work in the same way. Because matching_threshold
should be a constant value of 0.5, while feat_scores=tf.zeros(shape, dtype=dtype)
(https://github.com/balancap/SSD-Tensorflow/blob/master/nets/ssd_common.py#L57), the initial value of feat_scores
should be 0, which is clearly different with matching_threshold
.
For the second question, pmask
is the mask matrix for all positive anchors, which are potentially to have objects, and tf.logical_not(pmask)
is all the rest anchors. As for gscore > -0.5
, I still don't understand. I don't know why the gscore
has negative values. If you understand, could you please explain the reason?
This is my understanding. Sincerely
@ChenhongyiYang I don't know and not sure about that.
Sincerely
I think it's typo and should be 0.5, which is the ignore threshold.
There is no way that -0.5 is a typo. I don`t think -0.5 is a typo
I think negative value means there are anchors without annotation...
I change the -0.5 into 0.5 and it worked
Can you tell me how it worked?The loss becomes lower? 2640062655 邮箱:2640062655@qq.com 签名由 网易邮箱大师 定制 On 03/16/2019 22:57, Stpraha wrote: I change the -0.5 into 0.5 and it worked — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
Can you tell me how it worked?The loss becomes lower?
I'm trying to write a simple version SSD based on balancap's code. At first I copied this method and my model is not able to be trained. I reviewed this code and changed -0.5 to 0.5, then my model works. If you've reviewed his code, you would find that this line code doesn't work at all. Because feat_scores never less than 0. According to the comments in this code block, it should be 0.5
@stpraha I can understand that the feat_scores new less than 0. What about the accuracy? Does accuracy improve?
Can you get the same result with the author's experiment like the following?
Sincerely Yunlong
Thanks, At frist, I only focus on the loss function of balancap's code. I don't think 'N' which in loss function should be 'batch size', so I changed it and remain '-5', I found it worked well, the loss and mAP was OK. Now, I may have an another idea. 2640062655 邮箱:2640062655@qq.com 签名由 网易邮箱大师 定制 On 03/16/2019 23:12, Stpraha wrote: Can you tell me how it worked?The loss becomes lower? I'm trying to write a simple version SSD based on balancap's code. At first I copied this method and my model is not able to be trained. I reviewed this code and changed -0.5 to 0.5, then my model works. If you've reviewed his code, you would find that this line code doesn't work at all. Because feat_scores never less than 0. According to the comments in this code block, it should be 0.5 — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
@ylqi007
I haven't test this change on balancap's model. I just tried on my on model (using copied method).
The feat_scores
is initialized to 0. Then, it will be compared with jaccard score (IoU)
, and it will be the bigger one. feat_scores = tf.where(mask, jaccard, feat_scores)
Jaccard score will never be a negative value.
@stpraha Yes. In my opinion, both the Jaccard score and feat_scores will never be a negative value.
Do you have SSD code which can work? Can you share your code?
Sincerely
Could you please share your code??? stpraha
hello, i change -0.5 to a positive value even small enough, but when train some steps the loss of cross_entropy_pos is 0, because there isn't pos anchor, someone can help me what's wrong with this code or repo? thanks all
According to the code:
feat_scores
should be 0, therefore all the elements should be greater than -0.5.jaccard
should be greater than or equal to 0.mask=tf.greater(jaccard, feat_scores)
will select out all the element greater than 0 in jaccard.mask=tf.logical_and(mask, feat_scores>-0.5)
, initially all the elements of feat_scores should be 0, and it is always greater than -0.5. I don't understant whyfeat_scores>-0.5
.@balancap @yjmade I am not sure that my understanding is correct or not. Could you please give me some explanation when you are convenient.