question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NBEATS Optimal HyperParameters for large datasets

See original GitHub issue

Hi again!

Currently, I am training an NBEATS model on the following:

  • 10,000+ Timeseries of varying lengths (200-7000+) all with 4 past_covariates that match in timesteps. (quite a feat) I plan to use this model in a one-shot learning application.

Here are the model hyperparameters for the NBEATS model:

multiseries_multicov_nbeats = NBEATSModel(
    input_chunk_length=30,
    output_chunk_length=7,
    generic_architecture=True,
    num_stacks=10,
    num_blocks=3,
    num_layers=4,
    layer_widths=512,
    n_epochs=100,
    nr_epochs_val_period=1,
    batch_size=1600,
    model_name="nbeats_run",
    force_reset=True,
    pl_trainer_kwargs={
     "accelerator": "gpu",
     "gpus": [0]
    },
    save_checkpoints=True,
    random_state = 42,
)

multiseries_multicov_nbeats.fit(series = time_series_train, 
                       past_covariates=covariates_train)

I have changed the following: batch_size=800 --> 1600 num_blocks=1 --> 3

It currently takes me ~55 hours to train a single model, so experimentation is lengthy in time. 😢

  1. Any other optimal hyper-parameters to leverage for such large datasets from your experience?
  2. I assume grid search with Nbeats and multi covariates is not possible yet, correct?

Any and all recommendations would be most appreciated 👍 !

Thank you

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
gdevos010commented, May 26, 2022

You use the PyTorch lightning early stop callback

my_stopper = EarlyStopping(
                    monitor="val_loss",
                    patience=5,
                    min_delta=0.05,
                    mode='min',
                )
                pl_trainer_kwargs={"callbacks": [my_stopper]}

model = NBEATSModel(...,
                    pl_trainer_kwargs=pl_trainer_kwargs)

model.fit(
        series=train,
        val_series=val,
        past_covariates=train_covariates
        val_past_covariates=val_covariates
)
1reaction
hrzncommented, May 26, 2022

I also recommended you take a look at performance tuning recommendations for torch models here: https://unit8co.github.io/darts/userguide/torch_forecasting_models.html#performance-recommendations

Read more comments on GitHub >

github_iconTop Results From Across the Web

Settings of N-BEATS hyperparameters and ... - ResearchGate
This research proposed a multimodal deep fusion approach to forecast cybersickness from the user's physiological, head-tracking, and eye-tracking data. We ...
Read more >
N-BEATS Unleashed: Deep Forecasting Using Neural Basis ...
Allowing for some oversimplification, the product of these hyperparameters defines the tensor size of the model. Large parameter values can make it bump ......
Read more >
Time Series forecasting with NBEATS - DeepDetect
This blog post shows how to obtain much more configurable and accurate time-series forecasting models than with other methods. It's used by ...
Read more >
N-BEATS neural network for mid-term electricity load ... - arXiv
N-BEATS has demonstrated state-of-the-art performance on multiple large-scale datasets, including M4's [25] and is very computationally ...
Read more >
Understanding nbeats() & Training Our 1st N-BEATS
The Business Case - Developing a Best-in-Class Forecasting System (3:03). 0.3 What Tools are in Your Toolbox? Timetk: Time Series Data Preparation, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found