You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by GitBox <gi...@apache.org> on 2022/09/23 23:06:03 UTC

[GitHub] [tvm] zxybazh commented on a diff in pull request #12141: [Meta Schedule][XGBoost] Update the custom callback function of xgboost in meta schedule

zxybazh commented on code in PR #12141:
URL: https://github.com/apache/tvm/pull/12141#discussion_r979111997


##########
python/tvm/meta_schedule/cost_model/xgb_model.py:
##########
@@ -573,22 +592,19 @@ def rmse(ys_pred: np.ndarray, d_train: "xgb.DMatrix"):  # type: ignore # pylint:
         def avg_peak_score(ys_pred: np.ndarray, d_train: "xgb.DMatrix"):  # type: ignore # pylint: disable = unused-argument
             return self.d_train.average_peak_score(ys_pred, self.average_peak_n)
 
+        xgb_custom_callback = XGBoostCustomCallback(
+            early_stopping_rounds=self.early_stopping_rounds,
+            verbose_eval=self.verbose_eval,
+            fevals=[rmse, avg_peak_score],
+            evals=[(self.d_train.dmatrix, "tr")],
+            cvfolds=None,
+        )

Review Comment:
   I think we may not be able to move this down because it’s used as parameter in `callbacks=[xgb_custom_callback]`, wdyt?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org