I trained and saved two layer stacked CAE model by Pylearn2. I would like to load these models and transform a novel dataset. How should I do it?
This is my model:
l1 = serial.load('CAE_l1.pkl')
l2 = serial.load('CAE_l2.pkl')
print l1
<pylearn2.models.autoencoder.ContractiveAutoencoder object at 0x7f3bb6d482d0>
I also tried something like this but it does not work.
data = T.matrix('data')
transform = theano.function([data], l1(data))
This is what I do lately but not sure about its correctness:
data = T.matrix('data')
transform = theano.function([data], l1.encode(data))
X_1 = transform(X.astype(float32))