Update sp_train.m