New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implemented margin ranking loss #2264
Conversation
Thanks for opening your first pull request in this repository! Someone will review it when they have a chance. In the mean time, please be sure that you've handled the following things, to make the review process quicker and easier:
Thank you again for your contributions! 👍 |
Forgot to pull the latest update. Will reopen when done. |
Thanks for opening your first pull request in this repository! Someone will review it when they have a chance. In the mean time, please be sure that you've handled the following things, to make the review process quicker and easier:
Thank you again for your contributions! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @AndreiMihalea, Thanks for taking the time to work on this. This looks good to me. Just few minor comments. 👍
Thanks.
…n for input / output
This code touches the ANN code, and there was recently a big refactoring of the ANN code in #2259, so be sure to merge the master branch into your branch here to make sure that nothing will fail if this PR is merged. 👍 (I'm pasting this message into all possibly relevant PRs.) |
typename ThirdInputType, | ||
typename OutputType | ||
> | ||
void Backward(const FirstInputType& x1, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comment above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified with input1 / input2 and target.
…into marginranking-loss
Hey Andrie, No rush, just wanted your opinion on it. I think @zoq will provide better insight on how you should proceed, till then I would suggest not making any changes incase the current approach makes more sense. |
As discussed on IRC, I think it's okay to move forward with changes suggested (Take concatenated input), I think that makes the most sense. |
I modified the implementation. Hope it's ok now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also add to HISTORY.md?
src/mlpack/methods/ann/loss_functions/margin_ranking_loss_impl.hpp
Outdated
Show resolved
Hide resolved
src/mlpack/methods/ann/loss_functions/margin_ranking_loss_impl.hpp
Outdated
Show resolved
Hide resolved
Co-Authored-By: favre49 <40389657+favre49@users.noreply.github.com>
Co-Authored-By: favre49 <40389657+favre49@users.noreply.github.com>
Co-Authored-By: favre49 <40389657+favre49@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me, thanks for keeping up with the reviews :)
Looks good to me as well. Just one last thing, recently we merged #2339, where we templated the return type instead of directly using double. @AndreiMihalea, do you mind changing to that to conform with the rest of the code base. I will post a message in each function that has anything to do with loss functions. I hope that's okay. Thanks a lot. 👍 |
Hey there, This code touches the loss function portion of mlpack's codebase. Recently #2339 was merged where the switch was made to templated return type instead of just using double. So before we merge this, kindly make the changes for the same. I'm pasting this in all relevant PRs. Thanks a lot 👍 |
Modified it accordingly. Thanks. |
Great, No more comments from my side. Thanks a lot for the awesome work. 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Second approval provided automatically after 24 hours. 👍
Hello there! Thanks for your contribution. I see that this is your first contribution to mlpack. If you'd like to add your name to the list of contributors in In addition, if you'd like some stickers to put on your laptop, I'd be happy to help get them in the mail for you. Just send an email with your physical mailing address to stickers@mlpack.org, and then one of the mlpack maintainers will put some stickers in an envelope for you. It may take a few weeks to get them, depending on your location. 👍 |
All the tests are passing, I think we can merge this now. Thanks for keeping up with the repo changes, and thanks @kartikdutt18 for pointing it out. |
Implemented the margin ranking loss as proposed in the issue #2253 I opened. Can also be related to #2200