Nixtla / neuralforecast

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

Disable progress bar and lightning_logs #963

Closed ZhikangLai closed 2 months ago

ZhikangLai commented 2 months ago

Description

Hello there. Neuralforecast is excellent package. But I think some functions need to be improved. For instance, When I call the AutoModel,such as AutoRNN, and I will out lots of training message(train bar). Not everyone needs this information. So I think the creator of this toolbox can add this feature which can let user choose for themselves whether to ignore information about the training process.

Use case

h = 1 models = [AutoRNN(h = h, loss=MSE(), num_samples=10)] auto_nf = NeuralForecast(models=models, freq='D',local_scaler_type = 'minmax') auto_cv_df = auto_nf.cross_validation(df=No4, refit=0, n_windows = len(test_data))

and it will outbreak lots of unnecessary information for me: 1712739164275

ZhikangLai commented 2 months ago

additionally, I want to know "lightning_logs" folder is useful? it took up quite a lot of space in my computer 1712740098913

jmoralez commented 2 months ago

Hey. We use pytorch lightning's Trainer which sets those defaults. You can get rid of the progress bar by passing enable_progress_bar=False through the config. The lightning_logs directory also comes from that and it saves the losses during training (which you can then visualize through tensorboard) and you can get rid of those by passing logger=False through the config.

So by changing the code to the following you shouldn't see those anymore:

rnn_config = {
    **AutoRNN.get_default_config(h=h, backend='ray'),
    'enable_progress_bar': False,
    'logger': False,
}
models = [AutoRNN(h=h, loss=MSE(), config=rnn_config, num_samples=10)]
ZhikangLai commented 2 months ago

Hey. We use pytorch lightning's Trainer which sets those defaults. You can get rid of the progress bar by passing enable_progress_bar=False through the config. The lightning_logs directory also comes from that and it saves the losses during training (which you can then visualize through tensorboard) and you can get rid of those by passing logger=False through the config.

So by changing the code to the following you shouldn't see those anymore:

rnn_config = {
    **AutoRNN.get_default_config(h=h, backend='ray'),
    'enable_progress_bar': False,
    'logger': False,
}
models = [AutoRNN(h=h, loss=MSE(), config=rnn_config, num_samples=10)]

Thank you very much for your response. That's working.