How to contribute to the trained and tested PyBrain network and how to get the result

I predict the value, I have 2 input levels and an output level. Here is my code in which I trained the PyBrain network and then tested it, I skip how to give me a set of input data to the network and how to get the result. Please help me continue.

ds = SupervisedDataSet(2,1) tf = open('data.csv','r') for line in tf.readlines(): data = [float(x) for x in line.strip().split(',') if x != ''] indata = tuple(data[:2]) outdata = tuple(data[2:]) ds.addSample(indata,outdata) n = buildNetwork(ds.indim,8,8,ds.outdim,recurrent=True) t = BackpropTrainer(n,learningrate=0.01,momentum=0.5,verbose=True) t.trainOnDataset(ds,1000) t.testOnData(verbose=True) 

what should I do to give input and predict the input, How do I get the result for this input set. Thanks!!

+8
python neural-network pybrain
source share
1 answer

By calling the .ktivate () method of the network serving your input. In addition, more practical use is being activated in the dataset.

And a little hint, you can use your own python csv module

+2
source share

All Articles