tested pre-softmax part of run_cnn_switch.m.

should still also do gradient checks on autoencoder training and
softmax training