{"action":"closed","issue":{"url":"https://api.github.com/repos/andy-yun/pytorch-0.4-yolov3/issues/22","repository_url":"https://api.github.com/repos/andy-yun/pytorch-0.4-yolov3","labels_url":"https://api.github.com/repos/andy-yun/pytorch-0.4-yolov3/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/andy-yun/pytorch-0.4-yolov3/issues/22/comments","events_url":"https://api.github.com/repos/andy-yun/pytorch-0.4-yolov3/issues/22/events","html_url":"https://github.com/andy-yun/pytorch-0.4-yolov3/issues/22","id":363256067,"node_id":"MDU6SXNzdWUzNjMyNTYwNjc=","number":22,"title":"Possibly Incorrect Loss Terms","user":{"login":"glenn-jocher","id":26833433,"node_id":"MDQ6VXNlcjI2ODMzNDMz","avatar_url":"https://avatars3.githubusercontent.com/u/26833433?v=4","gravatar_id":"","url":"https://api.github.com/users/glenn-jocher","html_url":"https://github.com/glenn-jocher","followers_url":"https://api.github.com/users/glenn-jocher/followers","following_url":"https://api.github.com/users/glenn-jocher/following{/other_user}","gists_url":"https://api.github.com/users/glenn-jocher/gists{/gist_id}","starred_url":"https://api.github.com/users/glenn-jocher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glenn-jocher/subscriptions","organizations_url":"https://api.github.com/users/glenn-jocher/orgs","repos_url":"https://api.github.com/users/glenn-jocher/repos","events_url":"https://api.github.com/users/glenn-jocher/events{/privacy}","received_events_url":"https://api.github.com/users/glenn-jocher/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-09-24T18:00:27Z","updated_at":"2018-12-16T11:17:03Z","closed_at":"2018-12-16T11:17:03Z","author_association":"NONE","body":"Hello, thank you for your YOLOv3 repo. I noticed your loss term is different than the official YOLOv3 loss in at least two ways:\r\n\r\n1. I think you should use BCELoss for `loss_cls`, as the [YOLOv3 paper section 2.2](https://pjreddie.com/media/files/papers/YOLOv3.pdf) clearly states **\"During training we use binary cross-entropy loss for the class predictions.\"**\r\n\r\n2. Why is MSELoss used in place of BCELoss for `loss_conf`? Did you make this choice yourself or did you see this in darknet?\r\n\r\n3. Why divide `loss_coord` by 2?\r\n\r\nhttps://github.com/andy-yun/pytorch-0.4-yolov3/blob/master/yolo_layer.py#L161-L164\r\n```python        \r\nloss_coord = nn.MSELoss(size_average=False)(coord*coord_mask, tcoord*coord_mask)/2\r\nloss_conf = nn.MSELoss(size_average=False)(conf*conf_mask, tconf*conf_mask)\r\nloss_cls = nn.CrossEntropyLoss(size_average=False)(cls, tcls) if cls.size(0) > 0 else 0\r\nloss = loss_coord + loss_conf + loss_cls\r\n```\r\n\r\n"}}
{"actor":{"display_login":"andy-yun"}}