code refactoring

support different evaluation metrics when training GAM/GA2M