0

I am using python and pybrain for Neural Networks. Unfortunately, my sample is realy big and when the program print the errors on the training, my memory get full before the programm completed.

Is there anyway to not print the errors from the functions?

!!!! It's not a python error. It's pybrain feature. It's print the difference of the prediction and the real sample. For example "error: 0.00424".

Each time it makes a prediction, it print this string.

Here is my code

ds = SupervisedDataSet(1, 1)
ds.addSample(x,y) <--- in a "for" to add all my sample

net = FeedForwardNetwork() 
inp = LinearLayer(1) 
h1 = SigmoidLayer(1) 
outp = LinearLayer(1)

net.addOutputModule(outp) 
net.addInputModule(inp) 
net.addModule(h1)

net.addConnection(FullConnection(inp, h1))  
net.addConnection(FullConnection(h1, outp))

net.sortModules()

trainer = BackpropTrainer(net, ds)

trainer.trainOnDataset(ds)      ###
trainer.testOnData(verbose=True)### Here is where the function print the errors

net.activate((ind,))
Tasos
  • 7,325
  • 18
  • 83
  • 176

1 Answers1

0

You could use try/except, like this:

try:
    trainer.testOnData(verbose=True)
except Exception as e:
    <exception handling code>

or you could find the source of the error. Could you add the error you get to your question?

  • My mistake. It's not a Python error. It's a string "error: 0.0042" for example. It's feature of the pybrain. It makes a prediction for the real sample and print the difference of the prediction and the real. I will edit my post to make it clear for everyone – Tasos Jun 06 '13 at 12:50