Training now saves the optimal parameter

saves training parameter to trained.mat