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

[BUG] DeepAR prediction plotting issue #161

Open
Sharaddition opened this issue Oct 13, 2023 · 0 comments
Open

[BUG] DeepAR prediction plotting issue #161

Sharaddition opened this issue Oct 13, 2023 · 0 comments

Comments

@Sharaddition
Copy link

On plotting DeepAR predictions with plotly with time_series_prev enabled, the figure is not plotted.

Error

Sizes of tensors must match except in dimension 2. Expected size 95 but got size 37016 for tensor number 1 in the list.

To Reproduce

# Prepare test data
test_ts = TimeSeries.from_pd(test_df)
params = {'max_forecast_steps': 32,'n_past': 96, 'use_gpu': True}
if "max_forecast_steps" in params and params["max_forecast_steps"] is not None:
    n = min(len(test_ts) - 1, int(params["max_forecast_steps"]))
    test_ts, _ = test_ts.bisect(t=test_ts.time_stamps[n])

# Forecast
test_pred, test_err = model.forecast(time_stamps=test_ts.time_stamps, exog_data=exog_ts)
test_metrics = compute_metrics(evaluator, test_ts, test_pred)

# Draw prediction
figure = model.plot_forecast_plotly(
    time_series=test_ts, time_series_prev=train_ts, exog_data=exog_ts, plot_forecast_uncertainty=True
)
figure.update_layout(width=None, height=500)

Device

  • Colab Notebook
  • Merlion Version 2.0.2

Additional context
On removing the time_series_prev param the plot is drawn. The same code works for other DL models.

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