Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-20 Thread Jugurtha Hadjar
Aside from the obvious imports I've added (import numpy as np, etc), there are still undefined objects (`names`, `times_`, `feat`, `bind_ind`) and indentation errors. Can you post a *working* code to be sped up and a benchmarking test? As you're using Python 2, you can improve the code with th

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-18 Thread duncan smith
rs is the one that learns the parameters, and such that I guess is > the one that should be improved in order to speed up the process of learning > the parameter values) in the following link: > https://codereview.stackexchange.com/questions/183707/speeding-up-the-implementation-of-stoch

Why does random.choice() reject sets? was Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread Peter Otten
Chris Angelico wrote: > On Thu, Jan 18, 2018 at 6:28 AM, Ned Batchelder > wrote: >> You'll have to replace random.choice() with >> random.choice(list(...)), since you can't random.choice from a set. >> > > Side point: why can't you? You can random.sample from a set, I'm not sure this was a goo

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread Chris Angelico
On Thu, Jan 18, 2018 at 7:19 AM, Ned Batchelder wrote: > On 1/17/18 2:45 PM, Chris Angelico wrote: >> >> On Thu, Jan 18, 2018 at 6:28 AM, Ned Batchelder >> wrote: >>> >>> You'll have to replace random.choice() with >>> random.choice(list(...)), since you can't random.choice from a set. >>> >> Sid

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread Ned Batchelder
On 1/17/18 2:45 PM, Chris Angelico wrote: On Thu, Jan 18, 2018 at 6:28 AM, Ned Batchelder wrote: You'll have to replace random.choice() with random.choice(list(...)), since you can't random.choice from a set. Side point: why can't you? You can random.sample from a set, but random.choice requi

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread Chris Angelico
On Thu, Jan 18, 2018 at 6:28 AM, Ned Batchelder wrote: > You'll have to replace random.choice() with > random.choice(list(...)), since you can't random.choice from a set. > Side point: why can't you? You can random.sample from a set, but random.choice requires a sequence. It seems perfectly sane

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread Ned Batchelder
that should be improved in order to speed up the process of learning the parameter values) in the following link: https://codereview.stackexchange.com/questions/183707/speeding-up-the-implementation-of-stochastic-gradient-ascent-in-python It looks like you have lists that you are doing "in

Re: Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread breamoreboy
; updateFactors is the one that learns the parameters, and such that I guess is > the one that should be improved in order to speed up the process of learning > the parameter values) in the following link: > https://codereview.stackexchange.com/questions/183707/speeding-up-the-implementation-of-st

Speeding up the implementation of Stochastic Gradient Ascent in Python

2018-01-17 Thread leutrim . kaleci
process of learning the parameter values) in the following link: https://codereview.stackexchange.com/questions/183707/speeding-up-the-implementation-of-stochastic-gradient-ascent-in-python -- https://mail.python.org/mailman/listinfo/python-list