1
votes

I want to use the neural network to classify handwritten digits of MNIST dataset

I have created 2 layer neural network with 100 hidden unit and trained it using 60,000 * 784 trainImages matrix and 60,000 * 1 trainLabels

net = newff(trainImages,trainLabels,100)

how to test and calculate the error rate of the trained network with 10,000 * 784 testImages

1

1 Answers

2
votes

Training:

[net,tr]=train(net,trainImages',trainLabels');

Testing:

PredictedLabels = sim(net,testImages');
error_rate = 1- mean(PredictedLabels == testLabels');