-
Notifications
You must be signed in to change notification settings - Fork 192
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
How to load a channel_mix TTM model #228
Comments
By that I mean the inter-channel mixer. For example. I loaded ` TTM_MODEL_PATH = "ibm-granite/granite-timeseries-ttm-r2" model = get_model(TTM_MODEL_PATH, context_length=CONTEXT_LENGTH, prediction_length=PREDICTION_LENGTH,num_input_channels=1000).backbone for name,_ in model.named_parameters(): Result: encoder.patcher.weight |
@LightingMc you need to define the mode = 'mix_channel'
model = get_model(
TTM_MODEL_PATH,
context_length=CONTEXT_LENGTH,
prediction_length=PREDICTION_LENGTH,
num_input_channels=1000,
mode=mode # Pass 'mix_channel'
).backbone i hope this solves your issue! |
Thanks a lot. It worked. This is exactly what I was looking for. I got this error, which I was expecting. So, I understand that in a multivariate case, the user has to train their own model for their given number of channels. But will these new channel_feature_mixer layers be easier to train from scratch since the rest of the model is already trained? I mean will the dataset size and training time requirements be the same as training an entire TTM model from scratch? or will they be less instead? Some weights of TinyTimeMixerForPrediction were not initialized from the model checkpoint at ibm-granite/granite-timeseries-ttm-r2 and are newly initialized: ['backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.0.channel_feature_mixer.norm.norm.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.0.mixer_layers.1.channel_feature_mixer.norm.norm.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.0.channel_feature_mixer.norm.norm.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.1.mixer_layers.1.channel_feature_mixer.norm.norm.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.0.channel_feature_mixer.norm.norm.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.gating_block.attn_layer.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.mlp.fc1.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.mlp.fc1.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.mlp.fc2.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.mlp.fc2.weight', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.norm.norm.bias', 'backbone.encoder.mlp_mixer_encoder.mixers.2.mixer_layers.1.channel_feature_mixer.norm.norm.weight'] |
Yeah, well, according to their paper:
|
A detailed example of introducing a mixing in the decoder can be found here. In this example, we still leverage the pre-trained model for the encoder (backbone) but then apply mixing in the decoder (via the |
I saw that the currently available pre-trained models don't have a channel mixer in there. How do I introduce a channel_mixer into them?
The text was updated successfully, but these errors were encountered: