modified softmax_train.m