java - Error NullPointer Neuroph doOneLearningIteration -
i'm using neuroph 2.9 framework code ann predict housing prices. want every error every time run every epoch (to show improve of error on chart) cause error.
// create multi layer perceptron system.out.println("creating neural network"); multilayerperceptron neuralnet = new multilayerperceptron( transferfunctiontype.sigmoid, inputscount, hiddentscount1, outputscount); // set learning parameters momentumbackpropagation learningrule = new momentumbackpropagation(); learningrule.setlearningrate(0.3); learningrule.setmomentum(0.5); learningrule.setneuralnetwork(neuralnet); learningrule.settrainingset(trainset); learningrule.doonelearningiteration(trainset);
i this:
exception in thread "main" java.lang.nullpointerexception @ org.neuroph.nnet.learning.momentumbackpropagation.updateneuronweights(momentumbackpropagation.java:72) @ org.neuroph.nnet.learning.backpropagation.calculateerrorandupdateoutputneurons(backpropagation.java:83) @ org.neuroph.nnet.learning.backpropagation.updatenetworkweights(backpropagation.java:53) @ org.neuroph.core.learning.supervisedlearning.learnpattern(supervisedlearning.java:190) @ org.neuroph.core.learning.supervisedlearning.dolearningepoch(supervisedlearning.java:165) @ org.neuroph.core.learning.iterativelearning.doonelearningiteration(iterativelearning.java:245) @ com.thao.main.main(main.java:76)
the problem when use : learningrule.learn(trainset); it's ok, no error come out. documentation bad differ functions chose right function run right thing want.
the thing found doonelearningiteration function didn't work because inside them. it's not initiated. therefore, run, need override or run 1 epoch , doonelearningiteration. that's work me.
Comments
Post a Comment