public void TestManhattan() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); IMLTrain bprop = new ManhattanPropagation(network, trainingData, 0.01); NetworkUtil.TestTraining(bprop, 0.01); }
public void TestLMA() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); IMLTrain rprop = new LevenbergMarquardtTraining(network, trainingData); NetworkUtil.TestTraining(rprop, 0.03); }
public void TestRPROP() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); IMLTrain rprop = new ResilientPropagation(network, trainingData); NetworkUtil.TestTraining(rprop, 0.03); }
public void TestGenetic() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); ICalculateScore score = new TrainingSetScore(trainingData); NeuralGeneticAlgorithm genetic = new NeuralGeneticAlgorithm(network, new RangeRandomizer(-1, 1), score, 500, 0.1, 0.25); NetworkUtil.TestTraining(genetic, 0.00001); }
public void TestAnneal() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); ICalculateScore score = new TrainingSetScore(trainingData); NeuralSimulatedAnnealing anneal = new NeuralSimulatedAnnealing(network, score, 10, 2, 100); NetworkUtil.TestTraining(anneal, 0.01); }
public void TestGenetic() { IMLDataSet trainingData = new BasicMLDataSet(XOR.XORInput, XOR.XORIdeal); ICalculateScore score = new TrainingSetScore(trainingData); MLMethodGeneticAlgorithm genetic = new MLMethodGeneticAlgorithm(() => { return(NetworkUtil.CreateXORNetworkUntrained()); }, score, 500); NetworkUtil.TestTraining(genetic, 0.00001); }
public void TestRPROPFolded() { IMLDataSet trainingData = XOR.CreateNoisyXORDataSet(10); BasicNetwork network = NetworkUtil.CreateXORNetworkUntrained(); var folded = new FoldedDataSet(trainingData); IMLTrain train = new ResilientPropagation(network, folded); var trainFolded = new CrossValidationKFold(train, 4); EncogUtility.TrainToError(trainFolded, 0.2); XOR.VerifyXOR((IMLRegression)trainFolded.Method, 0.2); }