Theano use real number (float32 or float64), not bigfloat. If you need
bigfloat precission, there isn't easy way to do it in Theano. We have
stability optimization that help in some cases, but it isn't equivalent to
bigfloat.

If you have just one op that need bigfloat, you can build a quick Theano op
to wrap other python code that do the execution:

http://deeplearning.net/software/theano/tutorial/extending_theano.html#as-op

But your code:

[sympy.exp(x[i]) for i in range(dim)]

do not seem vectorised. In theano x would be a vector and you would just do
theano.tensor.exp(x).

Fred

On Wed, May 20, 2015 at 3:21 PM, <[email protected]> wrote:

> ok, I oversimplified my example. In fact my computations are in vectors.
> The problem seems to be that I cannot pass the results of
> [sympy.exp(x[i]) for i in range(dim)] to Theano (for x[i] small enough).
> Theano evaluate them as zero but here I need the real values of
> exp([x[i]]), where only
> sympy.exp can give me.
> Costas
>
> On Wednesday, May 20, 2015 at 4:57:18 PM UTC+3, Frédéric Bastien wrote:
>>
>> The execution by Theano should be faster when you work big not too small
>> inputs size. If you work only on scalar, Theano is probably not faster then
>> sympy.
>>
>> But if you work on vector/tensor big enough (this size depend of the
>> function...) then Theano get faster.
>>
>> Fred
>>
>> On Wed, May 20, 2015 at 9:48 AM, <[email protected]> wrote:
>>
>>> Thank you for your answer.
>>> So, in what sense theano cooperates with sympy (or the inverse)?
>>> Since, we can not have the advantage of sympy functions in theano.
>>> Costas
>>>
>>> On Wednesday, May 20, 2015 at 1:41:06 AM UTC+3, [email protected] wrote:
>>>>
>>>> Hi,
>>>>
>>>> I was experimenting with the following code:
>>>>
>>>> import sympy
>>>> from sympy.abc import x
>>>> expr = sympy.exp(-x ** 2)
>>>> from sympy.printing.theanocode import theano_function
>>>> fn_theano  = theano_function([x], [expr], dims={x: 1}, dtypes={x:
>>>> 'float64'})
>>>> print fn_theano([29.]),sympy.exp(-29.**2)
>>>>
>>>> I got
>>>>
>>>>
>>>> [ 0.] 5.73245586032578e-366
>>>>
>>>>
>>>> My question is why fn_theano does not  give the same value?
>>>>
>>>> Thank you,
>>>>
>>>> Costas
>>>>
>>>>
>>>>
>>>>  --
>>> You received this message because you are subscribed to the Google
>>> Groups "sympy" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at http://groups.google.com/group/sympy.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/sympy/3d09a5c6-eaea-4898-83cb-99b8a74f48a7%40googlegroups.com
>>> <https://groups.google.com/d/msgid/sympy/3d09a5c6-eaea-4898-83cb-99b8a74f48a7%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>  --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/sympy.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sympy/95980104-7afc-4b3c-b0e0-5d618f222d78%40googlegroups.com
> <https://groups.google.com/d/msgid/sympy/95980104-7afc-4b3c-b0e0-5d618f222d78%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sympy/CADKKbth2TQXuHvJ7w%3DwZ_sOsLdSY%3DvXmcaJQ8Hz5coiuUwESGg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to