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

'TimeNet' object has no attribute 'ar_weights' in model.fit() when n_lags is not set but ar_reg is set #1560

Open
5 tasks done
akosmaroy opened this issue Apr 4, 2024 · 0 comments

Comments

@akosmaroy
Copy link

akosmaroy commented Apr 4, 2024

Prerequisites

Describe the bug

I'm getting the following exception when calling model.fit():

'TimeNet' object has no attribute 'ar_weights'

To Reproduce

Create a NeuralProphet object with the following parameters:

        prophet_parameters = {
            # 'n_lags': 79,   <- this parameter is not set
            'ar_reg': 0.08971683614862916,   # <- this parameter is set
            'ar_layers': [116, 116, 116, 116, 116, 116],  # <- AR related parameter, but doesn't have an impact on the exception
            # the rest probably is not relevant to this bug
            'daily_seasonality': False,
            'weekly_seasonality': 'auto',
            'yearly_seasonality': 'auto',
            'accelerator': 'auto',
            'collect_metrics': ["MSE", "MAE", "RMSE"],
            'quantiles': quantiles,
            'n_forecasts': 2,
            'lagged_reg_layers': [82, 82], 
            'trend_reg': 0.9706135322078026,
            'n_changepoints': 91,
            'seasonality_mode': 'multiplicative',
            'seasonality_reg': 0.7543763277837088,
            'future_regressors_model': 'linear',
            'learning_rate': 1e-3,
        }

And call model.fit(). The exception is not thrown immediately, in this case it's thrown at epoch 67. Setting the 'n_lags': parameter makes it not throw the exception, as does removing both 'n_lags' and 'ar_reg'

The fact that the exception is thrown so late, e.g. on epoch 67 - implies that the model internal structure changes between epochs?

Expected behavior

model.fit() should not through this exception.

What actually happens

An exception with the following message is thrown:

'TimeNet' object has no attribute 'ar_weights'

Screenshots

n/a

Environment (please complete the following information):

Python 3.10.12
Ubuntu 22.04 in WSL on Windows 11
NeuralProphet installed from github latest, 2354356

Additional context

n/a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant