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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to