Nixtla / neuralforecast

Scalable and user friendly neural :brain: forecasting algorithms.
https://nixtlaverse.nixtla.io/neuralforecast
Apache License 2.0
2.98k stars 342 forks source link

fix early stopping in ray auto models #953

Closed jmoralez closed 5 months ago

jmoralez commented 6 months ago

The logic here https://github.com/Nixtla/neuralforecast/blob/9e0efab6a6507b0d10e67f2d668dac7c58dec1ab/neuralforecast/common/_base_multivariate.py#L124-L129 only added the early stopping callback if there weren't any callbacks already set. This made it so that it was never enabled for auto models that used ray, since we add the TuneReportCallback https://github.com/Nixtla/neuralforecast/blob/9e0efab6a6507b0d10e67f2d668dac7c58dec1ab/neuralforecast/common/_base_auto.py#L196

This fixes that check by building an empty list of callbacks if there aren't any and always appending EarlyStopping to the existing callbacks. Also moves some duplicated logic in the init signature of the base classes to the base model.

review-notebook-app[bot] commented 6 months ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB