ynd / cae.py Goto Github PK
View Code? Open in Web Editor NEWContractive Auto-Encoders in Numpy
Contractive Auto-Encoders in Numpy
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
How to run the cae.py? how to use the function sample()? and in function _jacobi_loss() has a Error:AxisError: axis 2 is out of bounds for array of dimension 2.
Please, THank you~
Just browsing around, noticed a typo in the word Contractive
.
class CAE(object):
"""
A Contrative Auto-Encoder (CAE) with sigmoid input units and sigmoid
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.