Re: [theano-users] Shared variable dynamic resize in computation graph

2017-01-17 Thread Zachary Kulis
Thank you for you reply, but I'm trying to understand why: hid_init = T.ones((input.shape[0], self.num_units), dtype=theano.config.floatX) * self.hid_init.get_value() always uses the initial value assigned to self.hid_init (which is a row of zeros). The computation graph seems not to actually

[theano-users] Shared variable dynamic resize in computation graph

2017-01-17 Thread Zachary Kulis
I'm trying to implement a stateful LSTM in Lasagne, and I'm having trouble dynamically sizing the matrix of initial states. Basically, I'm defining the initial hidden and cell states as shared variables, each with length equal to number of neurons. It's done this way because the batch size is

[theano-users] Re: Apply generic element wise function against tensor

2017-01-17 Thread Corey Nolet
Here's what my code in numpy looks like: tensor = shared(np.random.randn(7, 16, 16)) e_tensor = tensor.eval() tensor2 = e_tensor[0,:,:] tensor2[tensor2 < 1] = 0.0 tensor2[tensor2 > 0 = 1.0 new_tensor = [tensor2] for i in range(1, e_tensor.shape[0]): new_tensor.append(np.multiply(tensor2,

[theano-users] Apply generic element wise function against tensor

2017-01-17 Thread Corey Nolet
I have a tensor which is (7,16,16), let's denote as Tijk. I need to make the following function: for j in range(0, 16): for k in range(0, 16): if T0jk == 0: for i in range(1, 7): Tijk = 0 Any ideas on how this can be done with Theano's tensor API?

[theano-users] Re: Save and load MLP model

2017-01-17 Thread Desy rona
I mean datasets were used for training and testing, ie mnist_train.data, mnist_test.data, mnist_valid.data and mnist_train.solution I tried to download from