I was trying to build an auto-associative artificial neural network with python. I have tried to use the library pybrain. Here my code
from pybrain.tools.shortcuts import buildNetwork
from pybrain.datasets import SupervisedDataSet
from pybrain.supervised.trainers import BackpropTrainer
net = buildNetwork(20, 30, 2, 30, 20)
ds = SupervisedDataSet(20, 20)
for i in range(350):
ds.addSample(data[i,:20], data[i,:20])
trainer = BackpropTrainer(net, ds)
for i in range(50):
trainer.train()
net.activate(data[1,:20])
Ideas why doesn't learn correctly this small dataset? Can I use some other libraries? Am I doing something wrong