-
Notifications
You must be signed in to change notification settings - Fork 43
Conversation
Coverage remained the same at 97.886% when pulling 025c323e6d0788e712276d952846e97bf3cffb87 on speedup into 191fb42 on master. |
Coverage remained the same at 97.886% when pulling 89bdd3e803cc9a17611a16df3028895439a3a159 on speedup into 191fb42 on master. |
Coverage remained the same at 97.886% when pulling 41fdc4ed485ee125b7fee52175d69008919496fb on speedup into 191fb42 on master. |
@fabianp could you give me a hand to figure out why I'm getting these win32/py2 failures? It looks like the |
Hey. Went through the file cd_direct_fast.pyx but I don't know what can be causing such failures. Any chance you could make a minimal example for such failures? |
Since the win32 failures are independent of this PR, I think this PR should be merged, since it is a big improvement. I would also add a benchmark/ folder to help track the improvements over time. Regarding the failures, could it be that the random kit behave differently on win32? |
If that is the case, adding l2 regularization and/or more iterations should On Jul 25, 2016 2:49 PM, "Mathieu Blondel" notifications@github.com wrote:
|
Remember that FMs and PNs are non-convex :) |
@ogrisel From past experience with scikit-learn, any idea what the win32 failures could come from? By the way, the problem is only on Python 2.7. Python 3.5 is fine. |
D'oh! On Jul 25, 2016 2:55 PM, "Mathieu Blondel" notifications@github.com wrote:
|
Py_ssize_t order, | ||
double* out, | ||
int s, | ||
int degree): |
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's weird to use Py_ssize_t
for a mathematical variable. Py_ssize_t
should only be used to index arrays.
|
That makes sense. Thanks, @ogrisel! However the problem still existed when I was using int everywhere. I only replaced it with py_ssize_t in an attempt to fix it, and it seems I got a bit overzealous and replaced too many vars. I'll change it to use py_ssize_t just where it should. On July 25, 2016 10:23:48 AM EDT, Olivier Grisel notifications@github.com wrote:
Sent from my Android device with K-9 Mail. Please excuse my brevity. |
@mblondel I think it's not a rng issue. The I also fixed the types as suggested by @ogrisel with no difference. So it's probably something numerical. It's strange that no errors occur with the lifted solver though. Maybe I should try a 32bit py2 env in linux and see if I can reproduce it. |
if degree == 2: | ||
grad_y = d1[i] - p_js * data[ii] | ||
elif degree == 3: | ||
grad_y = 0.5 * (d1[i] ** 2 - d2[i]) |
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.
I am surprised that Cython doesn't optimize this directly. Did it make a significant difference?
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.
I was looking at the generated C++ and found that a ** 2
is compiled into pow(a, 2)
. However, it makes no difference in terms of speed. I guess the compiler inlines pow
calls efficiently.
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.
If there's no measurable speed up (which confirms my experience), I would favor the readable version.
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.
I agree, I'll revert.
Meanwhile a different win64+py2 failure appeared out of nowhere (?), I'll
try actually investigating on a windows machine.
On Tue, Jul 26, 2016 at 6:33 PM, Mathieu Blondel notifications@github.com
wrote:
In polylearn/cd_direct_fast.pyx
#1 (comment)
:@@ -71,14 +75,14 @@ cdef inline double _update(int* indices,
if degree == 2:
grad_y = d1[i] - p_js * data[ii]
elif degree == 3:
grad_y = 0.5 \* (d1[i] *\* 2 - d2[i])
If there's no measurable speed up (which confirms my experience), I would
favor the readable version.—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/scikit-learn-contrib/polylearn/pull/1/files/49a3d7e8d41eef91ca1126b8f03b35df61b9149f..95828c13a600f1dd8395fc82fec5ad6e03a019f1#r72350574,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAOwUR53YhHcCp9XgAq9xqlTiD7Pi3yjks5qZospgaJpZM4JO8xX
.
Is there a way to reduce the verbosity of coveralls? I receive one email per commit, which makes it a bit difficult to follow real comments. |
Ok, I think I made coveralls be quiet. |
I fixed the windows bug! It was my fault, of course. I forgot to initialize a Appveyor is green now for both win32 and win64. (I canceled a duplicate build, triggered by the fact that this branch is on scikit-learn-contrib rather than on my fork, feel free to ignore that.) I'll remove the ugly |
This is now ready to merge. |
Hurray! Squash and merge? |
Switch everything to typed memoryviews and inline direct solver update.