void testMNISTDataLoading(){ MNISTDataset mnist; mnist.loadData(); Logistic logi("result/LogisticModel.dat"); TrainModel logisticModel(logi); printf("validate error : %.8lf%%\n", 100.0 * logisticModel.getValidError(&mnist, 500)); }
void testMNISTLoading(){ MNISTDataset mnist; mnist.loadData(); MLP mlp("result/MLPModel.dat"); TrainModel mlpModel(mlp); printf("validate error : %.8lf%%\n", 100.0 * mlpModel.getValidError(&mnist, 20)); }
void testMNISTTraining(){ MNISTDataset mnist; mnist.loadData(); Logistic logi(mnist.getFeatureNumber(), mnist.getLabelNumber()); logi.setModelFile("result/LogisticModel.dat"); TrainModel logisticModel(logi); logisticModel.train(&mnist, 0.01, 10, 1000); }
void testMNISTGuassianTraining(){ MNISTDataset mnist; mnist.loadData(); mnist.rowNormalize(); Logistic logi(mnist.getFeatureNumber(), mnist.getLabelNumber()); logi.setModelFile("result/LogisticModel.dat"); TrainModel logisticModel(logi); logisticModel.train(&mnist, 0.13, 500, 100); }
void testMNIST(){ MNISTDataset mnist; mnist.loadData(); MLP mlp; SigmoidLayer *firstLayer = new SigmoidLayer(mnist.getFeatureNumber(), 500); Logistic *secondLayer = new Logistic(500, mnist.getLabelNumber()); mlp.addLayer(firstLayer); mlp.addLayer(secondLayer); mlp.setModelFile("result/MLPModel.dat"); TrainModel mlpModel(mlp); mlpModel.train(&mnist, 0.01, 20, 1); }