-
-
Notifications
You must be signed in to change notification settings - Fork 25.9k
MNT Cleaner cython cdef loss function in SGD #17191
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
Conversation
Thanks! I think, cpdef double dloss(self, double p, double y) nogil: might work (and allow access from pure Python) as long as the corresponding classes are decorated with |
|
No I mean |
I'm not saying that we should do it though, just that it might be possible. Any opinions @thomasjpfan @jeremiedbb ? |
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.
Looks good
One tiny perk of using the wrapper instead of cpdef is that compilation will be slightly faster compared to duplicating all methods
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.
OK, sounds good. Thanks!
What does this implement/fix? Explain your changes.
This PR simpliefies the derivative loss functions for SGD. It makes the distinction bewtween
cdef dloss() nogil:
for productive use anddef py_dloss():
for calls in the test suite only.