{"action":"created","issue":{"url":"https://api.github.com/repos/fchollet/keras/issues/2662","repository_url":"https://api.github.com/repos/fchollet/keras","labels_url":"https://api.github.com/repos/fchollet/keras/issues/2662/labels{/name}","comments_url":"https://api.github.com/repos/fchollet/keras/issues/2662/comments","events_url":"https://api.github.com/repos/fchollet/keras/issues/2662/events","html_url":"https://github.com/fchollet/keras/issues/2662","id":153695852,"number":2662,"title":"How to implement my own loss function?","user":{"login":"henry0312","id":433434,"avatar_url":"https://avatars.githubusercontent.com/u/433434?v=3","gravatar_id":"","url":"https://api.github.com/users/henry0312","html_url":"https://github.com/henry0312","followers_url":"https://api.github.com/users/henry0312/followers","following_url":"https://api.github.com/users/henry0312/following{/other_user}","gists_url":"https://api.github.com/users/henry0312/gists{/gist_id}","starred_url":"https://api.github.com/users/henry0312/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henry0312/subscriptions","organizations_url":"https://api.github.com/users/henry0312/orgs","repos_url":"https://api.github.com/users/henry0312/repos","events_url":"https://api.github.com/users/henry0312/events{/privacy}","received_events_url":"https://api.github.com/users/henry0312/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-05-09T03:11:18Z","updated_at":"2017-01-12T00:34:11Z","closed_at":null,"body":"I'm going to implement [RankNet](http://research.microsoft.com/en-us/um/people/cburges/papers/ICML_ranking.pdf), and I find I'll need my own loss function (cf. eq. (1) in the paper).\n\nThe loss function takes two arguments (not either y_true or y_pred, http://keras.io/objectives/) and returns one output. How do I implement it? Can I do it in the first place?\n### References\n- Burges, Chris, et al. \"Learning to rank using gradient descent.\" Proceedings of the 22nd international conference on Machine learning. ACM, 2005.  \n  http://research.microsoft.com/en-us/um/people/cburges/papers/ICML_ranking.pdf  \n  (cf. eq (1))\n- Burges, Christopher JC. \"From ranknet to lambdarank to lambdamart: An overview.\" Learning 11 (2010): 23-581.  \n  http://research.microsoft.com/pubs/132652/MSR-TR-2010-82.pdf  \n  (cf. section 2)\n"},"comment":{"url":"https://api.github.com/repos/fchollet/keras/issues/comments/272040620","html_url":"https://github.com/fchollet/keras/issues/2662#issuecomment-272040620","issue_url":"https://api.github.com/repos/fchollet/keras/issues/2662","id":272040620,"user":{"login":"htso","id":5498043,"avatar_url":"https://avatars.githubusercontent.com/u/5498043?v=3","gravatar_id":"","url":"https://api.github.com/users/htso","html_url":"https://github.com/htso","followers_url":"https://api.github.com/users/htso/followers","following_url":"https://api.github.com/users/htso/following{/other_user}","gists_url":"https://api.github.com/users/htso/gists{/gist_id}","starred_url":"https://api.github.com/users/htso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/htso/subscriptions","organizations_url":"https://api.github.com/users/htso/orgs","repos_url":"https://api.github.com/users/htso/repos","events_url":"https://api.github.com/users/htso/events{/privacy}","received_events_url":"https://api.github.com/users/htso/received_events","type":"User","site_admin":false},"created_at":"2017-01-12T00:34:11Z","updated_at":"2017-01-12T00:34:11Z","body":"@henry0312 Have you figured out how to code this? If you have, can you pls post some code snippet. I have similar need for a custom loss that takes three inputs. "}}
{"actor":{"display_login":"htso"}}