[sympy] Re: Summations for machine learning applications

2009-01-13 Thread Ondrej Certik
On Mon, Jan 12, 2009 at 2:12 PM, Danny dannytar...@gmail.com wrote: Hi, This isn't 100% fleshed out, but what do you think about something that works along these lines: xs, ys = ([], []) for i in range(1000): xs.append(random.randn()) ys.append(random.randn()) s = Sum('(x(i) * y(i)

[sympy] Re: Summations for machine learning applications

2009-01-07 Thread Ondrej Certik
On Mon, Jan 5, 2009 at 11:08 AM, Danny dannytar...@gmail.com wrote: Hi Ondrej, Thanks for the functions idea. Having to do the x substitution is a little annoying, but the suggestion helps enough to get me past that block, so I'm happy. Do you know how to do it more easily? If so, let's

[sympy] Re: Summations for machine learning applications

2009-01-05 Thread Danny
Hi Ondrej, Thanks for the functions idea. Having to do the x substitution is a little annoying, but the suggestion helps enough to get me past that block, so I'm happy. I can't promise anything quickly, but I should have enough now to make some headway on my original request. Danny On Dec

[sympy] Re: Summations for machine learning applications

2008-12-30 Thread Ondrej Certik
Hi Danny! On Mon, Dec 29, 2008 at 4:01 PM, Danny Tarlow dannytar...@gmail.com wrote: [...] Is this possible to do with Sympy? If I were interested in working on something like this, how hard would it be for a sympy newbie (but competent programmer) to implement? Any tips on where to start?

[sympy] Re: Summations for machine learning applications

2008-12-30 Thread Danny
Hi Ondrej, Thanks for the quick response. I took a look at the Sum class tests, but there is still one part I'm not clear on. In defining a summation, I would like to have the sum over an array of symbols, indexed by an iterate. For example, In the sum \sum_{i=0}^4 tau_i, I'd like each

[sympy] Re: Summations for machine learning applications

2008-12-30 Thread Ondrej Certik
2008/12/30 Danny dannytar...@gmail.com: Hi Ondrej, Thanks for the quick response. I took a look at the Sum class tests, but there is still one part I'm not clear on. In defining a summation, I would like to have the sum over an array of symbols, indexed by an iterate. For example, In

[sympy] Re: Summations for machine learning applications

2008-12-29 Thread Danny Tarlow
For concreteness, here is an example of one of my attempts: from sympy import * N = 5 # Number of data instances HOnes = Matrix(ones((1,N))) VOnes = Matrix(ones((N,1))) # Allocate variational mean parameters and put in matrix tau = [] for i in range(N): tau.append(Symbol('tau_' +