ynd/cae.py

Matricies not aligned on minimal example?

Closed this issue · 2 comments

Hi guys,

I cant get the code to run on a minimal example - see interactive python dump below. I have the strong feeling that I'm just missing something basic, here :)

Cheers and thanks
Malte

Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy
import cae
mycae=cae.CAE(n_hiddens=3,batch_size=1)
x=numpy.matrix([[0,0,0,1],[0,0,1,1]])
mycae.fit(x,verbose=True)
Traceback (most recent call last):
File "", line 1, in
File "cae.py", line 276, in fit
self._fit(X[inds[minibatch::n_batches]])
File "cae.py", line 243, in _fit
W_rec, b_rec, c_rec = _fit_reconstruction()
File "cae.py", line 238, in _fit_reconstruction
dh = numpy.dot(dr, self.W) * h * (1. - h)
File "/usr/lib/python2.7/dist-packages/numpy/matrixlib/defmatrix.py", line 341, in mul
return N.dot(self, asmatrix(other))
ValueError: matrices are not aligned

found it:
x=numpy.matrix([[0,0,0,1],[0,0,1,1]])
should have been
x=numpy.array([[0,0,0,1],[0,0,1,1]])

and it works like a charm

ynd commented

Didn't get the chance to answer, but good luck with the rest.

On Mon, Nov 24, 2014 at 3:57 PM, wohnjayne notifications@github.com wrote:

Closed #6 #6.


Reply to this email directly or view it on GitHub
#6 (comment).