fixed generate_trainining. data was in reverse order by row.