MNT Cleaner cython cdef loss function in SGD#17191
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 ? |
NicolasHug
left a comment
There was a problem hiding this comment.
Looks good
One tiny perk of using the wrapper instead of cpdef is that compilation will be slightly faster compared to duplicating all methods
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.