zishansami102 / CNN-from-Scratch

A scratch implementation of Convolutional Neural Network in Python using only numpy and validated over CIFAR-10 & MNIST Dataset
http://cnndigits.pythonanywhere.com/
GNU General Public License v3.0
271 stars 79 forks source link

How to handle non-numeric? #15

Closed tetrahydra closed 5 years ago

tetrahydra commented 5 years ago

I have a question, how to handle non-number prediction?

I tried your Demo and when I wrote C, it was predicted as 5 and when I wrote A, it gave 2.

How to extend the NN so that it can make an output "Unknown" / "Not in the list"?

zishansami102 commented 5 years ago

You need to add the "Unknown" class in the output layer and also need to mix the class relevant data with the MNIST set while training.

tetrahydra commented 5 years ago

so, it would not be possible to add "Unknown" class without adding data during training?

It looks like that the NN is eagerly want to answer even though the answer does not exist.

zishansami102 commented 5 years ago

Q: so, it would not be possible to add "Unknown" class without adding data during training? A: Standard? No! Naively? yes. By thresholding on the output scores (logits) before the softmax probabilities layer. There is always some naive way.

Q: It looks like that the NN is eagerly want to answer even though the answer does not exist. A: It is just a demonstration for digits. We can always engineer around that to build what we want.