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

Can we change predict_len if we use TTM model ? #102

Open
JieNi4 opened this issue Aug 5, 2024 · 5 comments
Open

Can we change predict_len if we use TTM model ? #102

JieNi4 opened this issue Aug 5, 2024 · 5 comments

Comments

@JieNi4
Copy link

JieNi4 commented Aug 5, 2024

Pretty good model! There are two models available (512-96 and 1024-96). The predict_len is set to 96, can we change it?

@wgifford
Copy link
Collaborator

wgifford commented Aug 5, 2024

Hi @JieNi4 thanks for your interest.

You can set prediction_filter_length to a value less than prediction_length and the model will only provide that many outputs. The loss will also be calculated based on prediction_filter_length; during fine tuning you can tune the existing head based on this shorter output.

@JieNi4
Copy link
Author

JieNi4 commented Aug 6, 2024

Thanks! Can we add multi-variance into zero-shot or fine-tuning(few-show) process? I have seen it's possible in your paper: "Decoder Channel-Mixing can be enabled during fine-tuning for capturing strong channel-correlation patterns across time-series variates, a critical capability lacking in existing counterparts." Thank you very much for your reply.

@wgifford
Copy link
Collaborator

wgifford commented Aug 6, 2024

Hi @JieNi4 yes -- if you fine-tune you can freeze the backbone, then enable channel mixing in the decoder and tune.

Some code snippets:

finetune_model = TinyTimeMixerForPrediction.from_pretrained(
    "ibm-granite/granite-timeseries-ttm-v1",
    num_input_channels=<num channels for your dataset>,
    decoder_mode="mix_channel",
)

# freeze parameters in the model backbone
for param in finetune_model.backbone.parameters():
    param.requires_grad = False

# define trainer
<standard training arguments, trainer definition>

trainer.train()

@JieNi4
Copy link
Author

JieNi4 commented Aug 7, 2024

@wgifford Thanks a lot. I have another question...We use scaling in both zero shot and few shot. But it seems that the final evaluation loss and plot_fig are also according to this Normalisation data. Can we use inverse method before we compute the loss and plot fig? And when the num of input channel is greater than 1, the loss seems to the mean of all channels? can we print all the loss separately?

@hwanyu112
Copy link

Since the forecast_length of TTM is set to 96, how to get the full zero shot evaluation results of different forecast lengths?

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

3 participants