Backpropagation neural net (3): Read data and train it
Code: "neural_net_3.py". Programming language: Python DMelt Version 1. Last modified: 05/09/2015. License: Pro
https://datamelt.org/code/cache/neural_net_3_5192.py
To run this script using the DMelt IDE, copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.


from jhplot import *
from jhplot.io import *

d=Serialized.read('data.ser')
input=d['input'].getRows('input',0,100)
out=d['out'].getRows('result',0,100)

net = HNeuralNet()
net.read("test.eg") # read NN from a file 

net.setData(input, out)
print net.trainBackpropagation(1,1000,0.001,0.02,0.005)

print "Epoch error=",net.getEpochError()
net.save("test_trained.eg")
net.showNetwork() # show network
net.showWeights() # show weight

Ads help maintain this website.