Pytorch-SiamFC icon indicating copy to clipboard operation
Pytorch-SiamFC copied to clipboard

the effect of the 'weight' in the function 'F.binary_cross_entropy_with_logits'

Open poppinjie opened this issue 4 years ago • 2 comments

Hello!Thanks for your work.It's complete(including training and tracking) and perfect. When I read the training code, I had a question. What's the effect of 'weight ' in the call 'F.binary_cross_entropy_with_logits' in 'losses.py'?

poppinjie avatar Nov 14 '19 12:11 poppinjie

Please have a look at parameter.json inside the experiment folder. You will see two hyperparameters : "pos_thr", "neg_thr". They are used to decide label values. ie. If the image within range pos_thr it get positive 1 , and in range between pos_thr and neg_thr it gets -1. If the distance is greater than neg_thr than that those labels's "weight" set as zero. If you read how lose is calculated again, you will see that weight zero pixels are not included in calculation.

gokberkyar avatar May 05 '20 21:05 gokberkyar

Thank you so much!After reading your reply,I understand.------------------ 原始邮件 ------------------ 发件人: "Gökberk Yar"[email protected] 发送时间: 2020年5月6日(星期三) 凌晨5:52 收件人: "rafellerc/Pytorch-SiamFC"[email protected]; 抄送: "poppinjie"[email protected];"Author"[email protected]; 主题: Re: [rafellerc/Pytorch-SiamFC] the effect of the 'weight' in thefunction 'F.binary_cross_entropy_with_logits' (#32)

Please have a look at parameter.json inside the experiment folder. You will see two hyperparameters : "pos_thr", "neg_thr". They are used to decide label values. ie. If the image within range pos_thr it get positive 1 , and in range between pos_thr and neg_thr it gets -1. If the distance is greater than neg_thr than that those labels's "weight" set as zero. If you read how lose is calculated again, you will see that weight zero pixels are not included in calculation.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

poppinjie avatar May 06 '20 00:05 poppinjie