How to use 0-3 class of number in MNIST

Take a look at this post which explains you could directly manipulate the internal targets and corresponding data.