Menu

#12 NullPointerExceptions in network's input and training.

open
nobody
None
5
2012-12-24
2011-04-30
Anonymous
No

nnInputTable.addElement(new TrainingElement(xxxxx));
NeuralNetwork neuralNet = MultiLayerPerceptron.load(xxxxx);
for (TrainingElement element : nnInputTable.trainingElements()) {
neuralNet.setInput(element.getInput());
}
cause NullPointerException during input (neuroph version 2.5.1).

MultiLayerPerceptron neuralNet = NeuralNetworkFactory.createMLPerceptron("172 132 93 53 14", TransferFunctionType.SIGMOID, MomentumBackpropagation.class, false,false);
LMS learningRule= (LMS) neuralNet.getLearningRule();
learningRule.setLearningRate(0.1);
learningRule.setMaxError(init_max_training_error);
learningRule.setMinErrorChange(0.0001);
learningRule.setMinErrorChangeIterationsLimit(100);
learningRule.setMaxIterations(1000);
((MomentumBackpropagation)learningRule1).setMomentum(0.1);
TrainingSet trainingSet = new TrainingSet();
trainingSet.addElement(new SupervisedTrainingElement(new double[] {x,x,x,x}, new double[] {x,x,x,x});
learningRule.learn(trainingSet);

cause NullPointerException during training (neuroph version 2.5.1 and 2.5b).

Discussion

MongoDB Logo MongoDB