{"action":"opened","issue":{"url":"https://api.github.com/repos/vlfeat/matconvnet/issues/1058","repository_url":"https://api.github.com/repos/vlfeat/matconvnet","labels_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/1058/labels{/name}","comments_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/1058/comments","events_url":"https://api.github.com/repos/vlfeat/matconvnet/issues/1058/events","html_url":"https://github.com/vlfeat/matconvnet/issues/1058","id":261039747,"number":1058,"title":"DagNN customised loss function","user":{"login":"jessicaloohw","id":32312766,"avatar_url":"https://avatars3.githubusercontent.com/u/32312766?v=4","gravatar_id":"","url":"https://api.github.com/users/jessicaloohw","html_url":"https://github.com/jessicaloohw","followers_url":"https://api.github.com/users/jessicaloohw/followers","following_url":"https://api.github.com/users/jessicaloohw/following{/other_user}","gists_url":"https://api.github.com/users/jessicaloohw/gists{/gist_id}","starred_url":"https://api.github.com/users/jessicaloohw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jessicaloohw/subscriptions","organizations_url":"https://api.github.com/users/jessicaloohw/orgs","repos_url":"https://api.github.com/users/jessicaloohw/repos","events_url":"https://api.github.com/users/jessicaloohw/events{/privacy}","received_events_url":"https://api.github.com/users/jessicaloohw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-09-27T16:31:27Z","updated_at":"2017-09-27T16:31:27Z","closed_at":null,"author_association":"NONE","body":"I am implementing a custom loss function and want to replace `vl_nnloss()` in the `SegmentationLoss()` class with 'custom_loss()`.\r\n\r\nI am confused as to what `custom_loss()` should return:\r\n\r\nIn the `forward()` pass, does `custom_loss()` return a single loss value?\r\n\r\nIn the 'backward()` pass, `custom_loss()` receives `DZDY` as an input parameter and should return `DZDX`. What are `DZDY` and `DZDX` i.e. what are `X`, `Y` and `Z`? Do I calculate the derivative of my custom loss, `Y` w.r.t. its inputs, `X` as `DYDX` and return `DZDX = DZDY .* DYDX`?\r\n\r\nIf the `forward()` pass of `custom_loss()` is calculated based on multiple inputs e.g. `X1` and `X2`, does the `backward()` pass return a separate value for each i.e. `DZDX1` and `DZDX2`?\r\n\r\nAny help with understanding this will be greatly appreciated!\r\n\r\nThank you!"}}
{"actor":{"display_login":"jessicaloohw"}}