vectorized cost function and back-prop
todo: regularize
Implements the neural network cost function
for a two layer neural network which performs classification