我在这里有同样的问题。类似的设置。它适用于我,当我强烈限制最大迭代。例如至10. 这让我想到,NeurophStudio中存在一个错误。
短提示,这对我有效: 自己动手!打开Eclipse,添加一个项目,添加Neuroph罐并构建您的网络。它很难,但是它的工作方式与预期完全相同。您必须将自己的结果转储到csv文件并使用Excel进行显示。但人工智能处理不仅仅是“点击一个gui”。
package de.sauer.dispe;
import org.neuroph.core.Layer;
import org.neuroph.core.NeuralNetwork;
import org.neuroph.core.Neuron;
import org.neuroph.core.data.DataSet;
import org.neuroph.core.transfer.Linear;
import org.neuroph.core.transfer.Tanh;
import org.neuroph.nnet.MultiLayerPerceptron;
import org.neuroph.nnet.learning.BackPropagation;
public class DirSpeCntrl {
private static final int MAX_ITER = 2000;
private static final double MAX_ERROR = 0.005;
private static final double LEARNING_RATE = 0.1;
public static void main(String[] args) {
System.out.println("Create ANN");
NeuralNetwork<BackPropagation> nn = new MultiLayerPerceptron(3, 15, 15, 1);
// Setting ALL neurons to TanH transferfunction (important, if you have negativ values)
Layer[] layers = nn.getLayers();
for(Layer curLayer: layers) {
for(Neuron curNeuron: curLayer.getNeurons()) {
curNeuron.setTransferFunction(new Tanh());
}
}
for(Neuron curNeuron: layers[3].getNeurons()) {
curNeuron.setTransferFunction(new Linear());
}
nn.randomizeWeights();
System.out.println("Load Sampledata...");
DataSet ds = DataSet.createFromFile(
"C:\\Users\\meist_000\\Documents\\Thesis\\vanilla_eng.csv",
3, 1, ";");
System.out.println("done: "+ds.getRows().size()+". Learn...");
// Setting stuff
BackPropagation lr = new BackPropagation();
lr.setLearningRate(LEARNING_RATE);
lr.setMaxIterations(MAX_ITER);
lr.setTrainingSet(ds);
lr.setNeuralNetwork(nn);
nn.setLearningRule(lr);
// bla.learn(ds); Faster bulk operation...
// Slower single operation with logging:
for(int i=0;i<MAX_ITER;i++) {
lr.doLearningEpoch(ds);
double curError = lr.getTotalNetworkError();
System.out.println(curError);
if(curError < MAX_ERROR) {
System.out.println("Stopped on "+i);
break;
}
}
// Testing the network
nn.setInput(new double[] {0.080484492, -0.138512128, -0.140826873});
nn.calculate();
double[] prediction = nn.getOutput();
System.out.println("Pred: "+prediction[0]);
}
}
这似乎不是一个编程问题,但更多的是如何使用现有程序“NeuroPh”的问题。 – MSalters
是的,但是如果你没有1500的声望,就没有办法添加NeuroPH标签,这就是为什么@ jalusa无法添加它,并且我添加了netbeans,它是neuroph背后的IDE。 – mCeviker