amazon-science / chronos-forecasting

Chronos: Pretrained (Language) Models for Probabilistic Time Series Forecasting
https://arxiv.org/abs/2403.07815
Apache License 2.0
2.38k stars 273 forks source link

>64 sample sizes returns results for 64 samples. #55

Closed Stealeristaken closed 5 months ago

Stealeristaken commented 5 months ago

Hi there! I recently utilized Chronos for a school project and encountered an issue regarding prediction length. Specifically, when setting the prediction length higher than 64 and using the sample size as the prediction length, Chronos consistently returns the same predictions, regardless of the specified length. Despite changing the prediction length, the predictions remain consistent at [64, 64, 64, 9].

        
df = ali[['date', 'open']]
context = torch.tensor(df["open"]) 
prediction_length = 201  
forecast = pipeline.predict(
    context,
    prediction_length,
    num_samples= 201,
    temperature=1.0,
    limit_prediction_length=False,
    top_k=50,
    top_p=1.0,
)
    

And the result is;

Ekran Resmi 2024-04-18 08 54 17
abdulfatir commented 5 months ago

Hi @Stealeristaken! Thanks for your interest.

To clarify, prediction_length is the number of future steps that will be sampled along the time axis and num_samples is the number of trajectories that will be sampled.

Can you check the following?

print(forecast.shape, type(forecast))

In general, when opening issues, it would be best if you share a working script.

abdulfatir commented 5 months ago

@Stealeristaken I am closing this due to inactivity. Please feel free to re-open if you're still facing this issue.