-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
paddle.nn.func.cosine_embedding_loss
#16728
Conversation
@hmahmood24 please review this PR |
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.
Hey @mobley-trent
Sorry for being late to review this PR🙂, somehow didn't notice it.
Would you update with the latest master branch changes for me to be able to run tests locally.
Thanks😊
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.
Hey @mobley-trent
Below are comments for changes, also is it possible to check the loss for large dimensions like 5 😅, try to explore if that's possible.
Thanks😊
) | ||
|
||
prod_sum = (input1 * input2).sum(axis=-1) | ||
mag_square1 = ivy.square(input1).sum(axis=-1) + 10e-12 |
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.
For proper notation we can use
mag_square1 = ivy.square(input1).sum(axis=-1) + 10e-12 | |
mag_square1 = ivy.square(input1).sum(axis=-1) + 1e-12 |
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.
Won't this intefere with the final values ?
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.
It won’t interfere as this is epsilon value and the notation should be scientific😄
The function only works for 1D or 2D tensors 😅 @hirwa-nshuti |
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.
Hey @mobley-trent
Now the tests are passing and all looks great😊
Feel free to merge this item🙂
Closes #16727