[theano-users] why does this gradient is invalid?

2017-08-09 Thread
I wonder why bellow code is invalid.. from numpy import * import theano.tensor as T x = T.dmatrix("x") mx = x[...,None,:] a = T.ones((1,3)) T.grad(mx[...,0].dot(a).sum(), a).eval({x:ones((5,10)).astype(float32)}) bellow error is emerged.

Re: [theano-users] why does this gradient is invalid?

2017-08-09 Thread
> Frédéric > > On Wed, Aug 9, 2017 at 4:50 AM 佐藤優 <say...@gmail.com > wrote: > >> I wonder why bellow code is invalid.. >> >> from numpy import * >> import theano.tensor as T >> x = T.dmatrix("x") >> mx = x[...,None,:] >>

[theano-users] Differences between theano.shared and numpy.ndarray.

2017-08-24 Thread
I saw follown defferences: import theano import theano.tensor as T import numpy as np o = np.ones((1,2,3)) o2= np.ones((2,1)) o2_shared = theano.shared(ones((2, 1))) print((o2 + o).shape) print((o2_shared + o).shape) result is (1, 2, 3) [1 2 1] Maybe, broadcasting result is