autoencoders icon indicating copy to clipboard operation
autoencoders copied to clipboard

test_sa.py fails..

Open why-not opened this issue 10 years ago • 0 comments

Here is the stack trace..

givens={self.x: data_shared[index * batch_size: (index + 1) * batch_size]}) Started the training.

Training at epoch 0

ValueError Traceback (most recent call last) /home/user/workspace/experiments/autoencoders/tests/test_sa.py in () 13 rnd = numpy.random.RandomState(1231) 14 print type(rnd) ---> 15 dae = SparseAutoencoder(input, nvis=28*28, nhid=2000, rnd=rnd) 16 dae.fit(data=x_data)

/home/user/workspace/experiments/autoencoders/sa.pyc in fit(self, data, learning_rate, batch_size, n_epochs, sparsity_penalty, sparsity_level, weights_file) 89 print "Training at epoch %d" % epoch 90 for batch_index in xrange(n_batches): ---> 91 ae_costs.append(train_ae(batch_index)) 92 print "Training at epoch %d, %f" % (epoch, numpy.mean(ae_costs)) 93

/home/user/anaconda/lib/python2.7/site-packages/theano/compile/function_module.pyc in call(self, _args, *_kwargs) 586 # For the CVM 587 gof.vm.raise_with_op(self.fn.nodes[self.fn.position_of_error], --> 588 self.fn.thunks[self.fn.position_of_error]) 589 else: 590 # For the c linker

/home/user/anaconda/lib/python2.7/site-packages/theano/compile/function_module.pyc in call(self, _args, *_kwargs) 577 t0_fn = time.time() 578 try: --> 579 outputs = self.fn() 580 except Exception: 581 if hasattr(self.fn, 'position_of_error'):

ValueError: Input dimension mis-match. (input[0].shape[1] = 784, input[1].shape[1] = 2000) Apply node that caused the error: Elemwise{Composite{[tanh(add(i0, i1))]}}[(0, 0)](Dot22.0, InplaceDimShuffle{x,0}.0) Inputs shapes: [(100, 784), (1, 2000)] Inputs strides: [(6272, 8), (16000, 8)] Inputs types: [TensorType(float64, matrix), TensorType(float64, row)]

why-not avatar Feb 24 '14 22:02 why-not