Sorry it took a while to respond to this. I believe you'll just have to include 
the gil before each print statement. At the beginning of the 
enet_coordinate_descent  algorithm you'll see a statement "with nogil:" which 
releases the python gil increasing the c performance. I suppose you could just 
remove the "with nogil:" though I'm not sure what kind of effect that would 
have. Is there a reason you want to use the gil for the entire algorithm apart 
from convenience?

From: [email protected]
Date: Thu, 4 Sep 2014 11:59:50 +0200
To: [email protected]
Subject: Re: [Scikit-learn-general] Print coordinate descent coefficients at 
each iteration

with gil:     print("something with gil")

That seems to work. What doesn't is to get the GIL for the whole algorithm (it 
compiles without errors but messes up the algorithm)


Un saludo,
Alberto



On Mon, Sep 1, 2014 at 5:36 PM, Danny Sullivan <[email protected]> wrote:





Hey Alberto,
Try
with gil:     print("something with gil")

Let me know if that works


Danny

From: [email protected]
Date: Mon, 1 Sep 2014 17:23:02 +0200
To: [email protected]


Subject: [Scikit-learn-general] Print coordinate descent coefficients at        
each iteration

Hi,

I would like to print the coordinate descent coefficients at each iteration. So 
far I've identified the code and variable I want to print. In particular I want 
to print the variable w in function enet_coordinate_descent from cd_fast.pyx. 
The problem is I do not have any previous experience with Cython and, as far as 
I've read, you can not simply put a print or a write statement because you run 
into problems with the GIL. Anyone has any pointers on how to solve this 
problem? Thank you very much in advance.









------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general               
                          

------------------------------------------------------------------------------

Slashdot TV.

Video for Nerds.  Stuff that matters.

http://tv.slashdot.org/
_______________________________________________

Scikit-learn-general mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/scikit-learn-general





------------------------------------------------------------------------------
Slashdot TV.  
Video for Nerds.  Stuff that matters.
http://tv.slashdot.org/
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general               
                          
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general

Reply via email to