dear all,

similar to problem in numpy here 
<http://stackoverflow.com/questions/26248654/numpy-return-0-with-divide-by-zero>

if element wise divide in theano ,  are there corresponding function in 
theano as this answer in numpy  ?  

numpy answer:

import numpy as np

a = np.array([0,0,1,1,2], dtype='float')
b = np.array([0,1,0,1,3], dtype='float')
with np.errstate(divide='ignore', invalid='ignore'):
    c = np.true_divide(a,b)
    c[c == np.inf] = 0
    c = np.nan_to_num(c)
print('c: {0}'.format(c))

Output:

c: [ 0.          0.          0.          1.          0.66666667]



how to process inf and nan problem when 0/0 or 1/0 problem in theano??

thanks



-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to