>From a hijacked thread in sympy-patches:

ma., 05.07.2010 kl. 14.04 -0700, skrev Brian Granger:
> On Mon, Jul 5, 2010 at 1:28 PM, Ronan Lamy <ronan.l...@gmail.com> wrote:
> > Le lundi 05 juillet 2010 à 19:17 +0200, Øyvind Jensen a écrit :
> >> > Yep.  I just got back from SciPy and I talked a lot with one of the
> >> > devs of theano:
> >> >
> >> > http://deeplearning.net/software/theano/
> >>
> >> Thanks for bringing theano to my attention!
> >
> > Yes, that's very interesting!
> >
> >> > Are you familiar with this?  It looks quite impressive and does code
> >> > generation for both CPUs and GPUs.  They actually have a lightweight
> >> > symbolic engine and they were interested in seeing if they could use
> >> > sympy instead.  It is definitely worst looking at.  I can contact them
> >> > if you want to explore this further.
> >> >
> >>
> >> Theano looks very nice, especially the GPU functionality is cool.  I
> >> will play with it and see what I can learn from it.  However, they use
> >> expression trees that are different from ours, so I fear it will be
> >> nontrivial to use it directly with sympy.  Whereas our tree consist of
> >> operations and operands, they have Apply-nodes that contain an operation
> >> instance and the operands.  I wonder how much their optimization
> >> framework depend on the form of the theano expression tree.
> >
> > Theirs is the obviously correct way of dealing with mathematical
> > functions in a CAS, but sympy will get there in the end (that's issue
> > 1688). In the mean time, there's an obvious bijection between f(x, y, z)
> > and Apply(f, (x, y, z)) so this doesn't seem to be a difficult problem.
> > On the other hand, theano uses types and variables, which sympy doesn't
> > have: I think this is a more significant barrier to translating between
> > the two.
> 
> I talked to James, one of the Theano devs, and I think it wouldn't be
> too difficult to use Sympy for the top level stuff, because of the
> bijection between the two data structures.  In terms of the types, my
> idea was to use the assumptions system.
> 
> > In any case, merging the two code bases seems a useful and achievable
> > medium-term goal.
> 
> Definitely.
> 

You are right.  The bijection between the expression trees is obvious,
and here[0] is an implementation.  So far, there is only methods to
convert the tree structure. So, essentially, I have implemented a
mapping between two different forms of SymPy expression trees.

So, how can the nodes be mapped to the right type in theano?  I agree
that assumptions can be part of the solution, in particular as a user
interface to specify the datatype as float16, int32 etc.  But, in order
to manipulate array expressions correctly in sympy, I think it will be
much easier to do it with something like Indexed [1], rather than
symbols with elaborate assumptions.

I am going to improve the Indexed module with functions to check
conformance of arrays, and it could be an idea to implement checks of
numpy broadcasting.  In fact, I think now that numpy compatibility
should be stated as an explicit goal of the Indexed class.

Cheers,
Øyvind

[0]: http://github.com/jegerjensen/sympy/tree/theano
[1]:
http://github.com/jegerjensen/sympy/blob/fortran_codegen4/sympy/tensor/indexed.py

> Cheers,
> 
> Brian
> 
> > Ronan
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "sympy-patches" group.
> > To post to this group, send email to sympy-patc...@googlegroups.com.
> > To unsubscribe from this group, send email to 
> > sympy-patches+unsubscr...@googlegroups.com.
> > For more options, visit this group at 
> > http://groups.google.com/group/sympy-patches?hl=en.
> >
> >
> 
> 
> 
> -- 
> Brian E. Granger, Ph.D.
> Assistant Professor of Physics
> Cal Poly State University, San Luis Obispo
> bgran...@calpoly.edu
> elliso...@gmail.com
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To post to this group, send email to sy...@googlegroups.com.
To unsubscribe from this group, send email to 
sympy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy?hl=en.

Reply via email to