Пример #1
0
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);
}
Пример #2
0
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);
}
Пример #3
0
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);
}