{"action":"created","comment":{"url":"https://api.github.com/repos/davisking/dlib/pulls/comments/137947632","pull_request_review_id":61682845,"id":137947632,"diff_hunk":"@@ -757,19 +757,19 @@ namespace dlib\n                         if(image_rect_to_feat_coord(p, input_tensor, x, x.label, sub, k))\n                         {\n                             // Ignore boxes that can't be detected by the CNN.\n-                            loss -= 1;\n+                            loss -= options.loss_per_missed_target;\n                             continue;\n                         }\n                         const size_t idx = (k*output_tensor.nr() + p.y())*output_tensor.nc() + p.x();\n                         loss -= out_data[idx];\n                         // compute gradient\n-                        g[idx] = -scale;\n+                        g[idx] = -scale * options.loss_per_missed_target;","path":"dlib/dnn/loss.h","position":12,"original_position":12,"commit_id":"e386ff52f24b4987148bca72649ede44afdc1358","original_commit_id":"e386ff52f24b4987148bca72649ede44afdc1358","user":{"login":"reunanen","id":2297572,"avatar_url":"https://avatars2.githubusercontent.com/u/2297572?v=4","gravatar_id":"","url":"https://api.github.com/users/reunanen","html_url":"https://github.com/reunanen","followers_url":"https://api.github.com/users/reunanen/followers","following_url":"https://api.github.com/users/reunanen/following{/other_user}","gists_url":"https://api.github.com/users/reunanen/gists{/gist_id}","starred_url":"https://api.github.com/users/reunanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reunanen/subscriptions","organizations_url":"https://api.github.com/users/reunanen/orgs","repos_url":"https://api.github.com/users/reunanen/repos","events_url":"https://api.github.com/users/reunanen/events{/privacy}","received_events_url":"https://api.github.com/users/reunanen/received_events","type":"User","site_admin":false},"body":"Oh, ok. I admit that I was working mainly based on trial and error. But even if I made `loss_per_missed_target` really high, it didn't seem to affect the results. Guess I just need to try and err more. Thanks for your prompt reply.","created_at":"2017-09-10T11:57:54Z","updated_at":"2017-09-10T11:57:54Z","html_url":"https://github.com/davisking/dlib/pull/812#discussion_r137947632","pull_request_url":"https://api.github.com/repos/davisking/dlib/pulls/812","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/davisking/dlib/pulls/comments/137947632"},"html":{"href":"https://github.com/davisking/dlib/pull/812#discussion_r137947632"},"pull_request":{"href":"https://api.github.com/repos/davisking/dlib/pulls/812"}},"in_reply_to_id":137947364},"pull_request":{"url":"https://api.github.com/repos/davisking/dlib/pulls/812","id":140204859,"html_url":"https://github.com/davisking/dlib/pull/812","diff_url":"https://github.com/davisking/dlib/pull/812.diff","patch_url":"https://github.com/davisking/dlib/pull/812.patch","issue_url":"https://api.github.com/repos/davisking/dlib/issues/812","number":812,"state":"open","locked":false,"title":"Let custom loss values affect MMOD gradient","user":{"login":"reunanen","id":2297572,"avatar_url":"https://avatars2.githubusercontent.com/u/2297572?v=4","gravatar_id":"","url":"https://api.github.com/users/reunanen","html_url":"https://github.com/reunanen","followers_url":"https://api.github.com/users/reunanen/followers","following_url":"https://api.github.com/users/reunanen/following{/other_user}","gists_url":"https://api.github.com/users/reunanen/gists{/gist_id}","starred_url":"https://api.github.com/users/reunanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reunanen/subscriptions","organizations_url":"https://api.github.com/users/reunanen/orgs","repos_url":"https://api.github.com/users/reunanen/repos","events_url":"https://api.github.com/users/reunanen/events{/privacy}","received_events_url":"https://api.github.com/users/reunanen/received_events","type":"User","site_admin":false},"body":"**Problem**: It looked like `loss_per_missed_target` and `loss_per_false_alarm` only affected the calculated loss, and not the gradient. Therefore, it also looked like these values did not affect the training result.\r\n\r\n**Solution**: Make it so that these values enter the calculation of the gradient. Add test cases as well.\r\n\r\n---\r\n\r\nAlso, while at it, fix even loss from ignored rects when using `loss_per_missed_target != 1`.","created_at":"2017-09-10T11:16:01Z","updated_at":"2017-09-10T11:57:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dbda368386d5dd8bb0d63f4322ff00a9c18cf7b6","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/davisking/dlib/pulls/812/commits","review_comments_url":"https://api.github.com/repos/davisking/dlib/pulls/812/comments","review_comment_url":"https://api.github.com/repos/davisking/dlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/davisking/dlib/issues/812/comments","statuses_url":"https://api.github.com/repos/davisking/dlib/statuses/e386ff52f24b4987148bca72649ede44afdc1358","head":{"label":"reunanen:let-custom-loss-affect-mmod-gradient","ref":"let-custom-loss-affect-mmod-gradient","sha":"e386ff52f24b4987148bca72649ede44afdc1358","user":{"login":"reunanen","id":2297572,"avatar_url":"https://avatars2.githubusercontent.com/u/2297572?v=4","gravatar_id":"","url":"https://api.github.com/users/reunanen","html_url":"https://github.com/reunanen","followers_url":"https://api.github.com/users/reunanen/followers","following_url":"https://api.github.com/users/reunanen/following{/other_user}","gists_url":"https://api.github.com/users/reunanen/gists{/gist_id}","starred_url":"https://api.github.com/users/reunanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reunanen/subscriptions","organizations_url":"https://api.github.com/users/reunanen/orgs","repos_url":"https://api.github.com/users/reunanen/repos","events_url":"https://api.github.com/users/reunanen/events{/privacy}","received_events_url":"https://api.github.com/users/reunanen/received_events","type":"User","site_admin":false},"repo":{"id":76554623,"name":"dlib","full_name":"reunanen/dlib","owner":{"login":"reunanen","id":2297572,"avatar_url":"https://avatars2.githubusercontent.com/u/2297572?v=4","gravatar_id":"","url":"https://api.github.com/users/reunanen","html_url":"https://github.com/reunanen","followers_url":"https://api.github.com/users/reunanen/followers","following_url":"https://api.github.com/users/reunanen/following{/other_user}","gists_url":"https://api.github.com/users/reunanen/gists{/gist_id}","starred_url":"https://api.github.com/users/reunanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/reunanen/subscriptions","organizations_url":"https://api.github.com/users/reunanen/orgs","repos_url":"https://api.github.com/users/reunanen/repos","events_url":"https://api.github.com/users/reunanen/events{/privacy}","received_events_url":"https://api.github.com/users/reunanen/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/reunanen/dlib","description":"A toolkit for making real world machine learning and data analysis applications in C++","fork":true,"url":"https://api.github.com/repos/reunanen/dlib","forks_url":"https://api.github.com/repos/reunanen/dlib/forks","keys_url":"https://api.github.com/repos/reunanen/dlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/reunanen/dlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/reunanen/dlib/teams","hooks_url":"https://api.github.com/repos/reunanen/dlib/hooks","issue_events_url":"https://api.github.com/repos/reunanen/dlib/issues/events{/number}","events_url":"https://api.github.com/repos/reunanen/dlib/events","assignees_url":"https://api.github.com/repos/reunanen/dlib/assignees{/user}","branches_url":"https://api.github.com/repos/reunanen/dlib/branches{/branch}","tags_url":"https://api.github.com/repos/reunanen/dlib/tags","blobs_url":"https://api.github.com/repos/reunanen/dlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/reunanen/dlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/reunanen/dlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/reunanen/dlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/reunanen/dlib/statuses/{sha}","languages_url":"https://api.github.com/repos/reunanen/dlib/languages","stargazers_url":"https://api.github.com/repos/reunanen/dlib/stargazers","contributors_url":"https://api.github.com/repos/reunanen/dlib/contributors","subscribers_url":"https://api.github.com/repos/reunanen/dlib/subscribers","subscription_url":"https://api.github.com/repos/reunanen/dlib/subscription","commits_url":"https://api.github.com/repos/reunanen/dlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/reunanen/dlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/reunanen/dlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/reunanen/dlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/reunanen/dlib/contents/{+path}","compare_url":"https://api.github.com/repos/reunanen/dlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/reunanen/dlib/merges","archive_url":"https://api.github.com/repos/reunanen/dlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/reunanen/dlib/downloads","issues_url":"https://api.github.com/repos/reunanen/dlib/issues{/number}","pulls_url":"https://api.github.com/repos/reunanen/dlib/pulls{/number}","milestones_url":"https://api.github.com/repos/reunanen/dlib/milestones{/number}","notifications_url":"https://api.github.com/repos/reunanen/dlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/reunanen/dlib/labels{/name}","releases_url":"https://api.github.com/repos/reunanen/dlib/releases{/id}","deployments_url":"https://api.github.com/repos/reunanen/dlib/deployments","created_at":"2016-12-15T11:39:58Z","updated_at":"2016-12-15T11:40:04Z","pushed_at":"2017-09-10T11:36:13Z","git_url":"git://github.com/reunanen/dlib.git","ssh_url":"git@github.com:reunanen/dlib.git","clone_url":"https://github.com/reunanen/dlib.git","svn_url":"https://github.com/reunanen/dlib","homepage":"dlib.net","size":16923,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"davisking:master","ref":"master","sha":"ef57efc7423ffde2b51a3afc4fa514b7134a7dc5","user":{"login":"davisking","id":6259399,"avatar_url":"https://avatars1.githubusercontent.com/u/6259399?v=4","gravatar_id":"","url":"https://api.github.com/users/davisking","html_url":"https://github.com/davisking","followers_url":"https://api.github.com/users/davisking/followers","following_url":"https://api.github.com/users/davisking/following{/other_user}","gists_url":"https://api.github.com/users/davisking/gists{/gist_id}","starred_url":"https://api.github.com/users/davisking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisking/subscriptions","organizations_url":"https://api.github.com/users/davisking/orgs","repos_url":"https://api.github.com/users/davisking/repos","events_url":"https://api.github.com/users/davisking/events{/privacy}","received_events_url":"https://api.github.com/users/davisking/received_events","type":"User","site_admin":false},"repo":{"id":16331291,"name":"dlib","full_name":"davisking/dlib","owner":{"login":"davisking","id":6259399,"avatar_url":"https://avatars1.githubusercontent.com/u/6259399?v=4","gravatar_id":"","url":"https://api.github.com/users/davisking","html_url":"https://github.com/davisking","followers_url":"https://api.github.com/users/davisking/followers","following_url":"https://api.github.com/users/davisking/following{/other_user}","gists_url":"https://api.github.com/users/davisking/gists{/gist_id}","starred_url":"https://api.github.com/users/davisking/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davisking/subscriptions","organizations_url":"https://api.github.com/users/davisking/orgs","repos_url":"https://api.github.com/users/davisking/repos","events_url":"https://api.github.com/users/davisking/events{/privacy}","received_events_url":"https://api.github.com/users/davisking/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/davisking/dlib","description":"A toolkit for making real world machine learning and data analysis applications in C++","fork":false,"url":"https://api.github.com/repos/davisking/dlib","forks_url":"https://api.github.com/repos/davisking/dlib/forks","keys_url":"https://api.github.com/repos/davisking/dlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/davisking/dlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/davisking/dlib/teams","hooks_url":"https://api.github.com/repos/davisking/dlib/hooks","issue_events_url":"https://api.github.com/repos/davisking/dlib/issues/events{/number}","events_url":"https://api.github.com/repos/davisking/dlib/events","assignees_url":"https://api.github.com/repos/davisking/dlib/assignees{/user}","branches_url":"https://api.github.com/repos/davisking/dlib/branches{/branch}","tags_url":"https://api.github.com/repos/davisking/dlib/tags","blobs_url":"https://api.github.com/repos/davisking/dlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/davisking/dlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/davisking/dlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/davisking/dlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/davisking/dlib/statuses/{sha}","languages_url":"https://api.github.com/repos/davisking/dlib/languages","stargazers_url":"https://api.github.com/repos/davisking/dlib/stargazers","contributors_url":"https://api.github.com/repos/davisking/dlib/contributors","subscribers_url":"https://api.github.com/repos/davisking/dlib/subscribers","subscription_url":"https://api.github.com/repos/davisking/dlib/subscription","commits_url":"https://api.github.com/repos/davisking/dlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/davisking/dlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/davisking/dlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/davisking/dlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/davisking/dlib/contents/{+path}","compare_url":"https://api.github.com/repos/davisking/dlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/davisking/dlib/merges","archive_url":"https://api.github.com/repos/davisking/dlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/davisking/dlib/downloads","issues_url":"https://api.github.com/repos/davisking/dlib/issues{/number}","pulls_url":"https://api.github.com/repos/davisking/dlib/pulls{/number}","milestones_url":"https://api.github.com/repos/davisking/dlib/milestones{/number}","notifications_url":"https://api.github.com/repos/davisking/dlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/davisking/dlib/labels{/name}","releases_url":"https://api.github.com/repos/davisking/dlib/releases{/id}","deployments_url":"https://api.github.com/repos/davisking/dlib/deployments","created_at":"2014-01-29T00:45:33Z","updated_at":"2017-09-10T11:33:19Z","pushed_at":"2017-09-10T11:36:15Z","git_url":"git://github.com/davisking/dlib.git","ssh_url":"git@github.com:davisking/dlib.git","clone_url":"https://github.com/davisking/dlib.git","svn_url":"https://github.com/davisking/dlib","homepage":"dlib.net","size":16940,"stargazers_count":2696,"watchers_count":2696,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":935,"mirror_url":null,"open_issues_count":50,"forks":935,"open_issues":50,"watchers":2696,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/davisking/dlib/pulls/812"},"html":{"href":"https://github.com/davisking/dlib/pull/812"},"issue":{"href":"https://api.github.com/repos/davisking/dlib/issues/812"},"comments":{"href":"https://api.github.com/repos/davisking/dlib/issues/812/comments"},"review_comments":{"href":"https://api.github.com/repos/davisking/dlib/pulls/812/comments"},"review_comment":{"href":"https://api.github.com/repos/davisking/dlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/davisking/dlib/pulls/812/commits"},"statuses":{"href":"https://api.github.com/repos/davisking/dlib/statuses/e386ff52f24b4987148bca72649ede44afdc1358"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"reunanen"}}