|
The convolutional mlp (Theano) example in the DeepLearningTutorials on deeplearning.net works fine except it doesn't include any hints on how to actually do a single forward pass to do a classification on a new sample with a trained network. I've tried a number of things but it seems like everything is setup exactly and only to do the training but not the classification. Does anybody know how to go about doing this? |
|
The script is indeed a demonstration piece, but everything you need to do classification on new data is in there. Focus on lines 183 - 193 in the convolutional_mlp.py example. The logistic regression object layer3 performs the classification:
and the theano.function test_model (see below) computes the 0-1 loss on a mini-batch of data. If you want to compute some predicted labels for new data, you will need to construct another theano.function object whose output is the predicted labels (i.e layer3.y_pred instead of layer3.errors(y)).
You will have to package up your new data, denoted above as my_new_data, in the same format as the theano.shared objects returned by load_data (see logistic_sgd.py). Hope this helps, Thanks! It worked! :D
(Jun 21 '13 at 18:28)
Rolf van Dam
|