Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is there a way to train a forecasting model for a few epochs with one training length, and then increase the length for some further epochs? #2345

Open
chododom opened this issue Apr 21, 2024 · 3 comments
Labels
question Further information is requested

Comments

@chododom
Copy link

I would like to test training for example the RNN for the prediction of 4 time steps ahead, and after a while, increase the horizon to for example 8 steps. Can I change this behaviour of the model somehow?

@chododom chododom added the triage Issue waiting for triaging label Apr 21, 2024
@dennisbader
Copy link
Collaborator

Hi @chododom, internally RNN has an output_chunk_length=1, meaning during prediction when n>output_chunk_length it will always perform auto-regression (consuming it's own predictions for future predictions) to forecast n points.

training_length just means how of those auto-regressive predictions it performs for one sample during training.

You can do two things:

  • simply increase n from 4 to 8 when calling predict()
  • multiple training:
    • train a model1 with the lower training_length
    • save the model with model1.save(...)
    • create a new model2 object with the same hyperparameters but different training_length
    • load the weights from model1 save into model2 with model2.load_weights(...) (since training_length changed, for this to work you need to set skip_checks=True, and load_encoders=False).
    • train model2

@adesso-dominik-chodounsky

@dennisbader Thank you for the advice! Do you think this will also work with the TFT model? If I understand correctly, the TFT has a built-in prediction horizon length.

@dennisbader
Copy link
Collaborator

@adesso-dominik-chodounsky, any of Darts' torch models (neural networks) and regression models support auto-regressive predictions with n>output_chunk_length. The only requirement is that if you use past/future_covariates, you must know these far enough into the future to generate the n prediction points.

@madtoinou madtoinou added question Further information is requested and removed triage Issue waiting for triaging labels Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants