rafellerc / Pytorch-SiamFC

Pytorch implementation of "Fully-Convolutional Siamese Networks for Object Tracking"
Other
609 stars 148 forks source link

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

Open poppinjie opened 4 years ago

poppinjie commented 4 years ago

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'?

gokberkyar commented 4 years ago

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.

poppinjie commented 4 years ago

Thank you so much!After reading your reply,I understand.------------------ 原始邮件 ------------------ 发件人: "Gökberk Yar"notifications@github.com 发送时间: 2020年5月6日(星期三) 凌晨5:52 收件人: "rafellerc/Pytorch-SiamFC"Pytorch-SiamFC@noreply.github.com; 抄送: "poppinjie"1347425300@qq.com;"Author"author@noreply.github.com; 主题: 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.