Open tdg2088 opened 2 months ago
cc @kashif
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.
Please note that issues that do not follow the contributing guidelines are likely to be ignored.
Thank you for your response and reminder.
To further clarify and provide more details, here is an update on the current situation:
Original Issue: I encountered a matrix dimension mismatch error when using PatchTSMixerForTimeSeriesClassification
for time series classification: mat1 and mat2 shapes cannot be multiplied (1x18000 and 17280x3)
. This occurred with the following configuration:
config = PatchTSMixerConfig(
context_length=context_length,
prediction_length=prediction_length,
num_classes=num_classes,
patch_length=1,
num_input_channels=num_input_channels,
patch_stride=1,
d_model=720,
num_layers=3,
expansion_factor=3,
dropout=0.1,
head_dropout=0.7,
mode="common_channel",
scaling="std",
)
Attempted Solution: I tried modifying the PatchTSMixerConfig
as follows:
config = PatchTSMixerConfig(
context_length=context_length,
prediction_length=prediction_length,
num_classes=num_classes,
patch_length=15,
num_input_channels=num_input_channels + 1,
patch_stride=15,
d_model=30,
num_layers=3,
expansion_factor=3,
dropout=0.1,
head_dropout=0.7,
mode="common_channel",
scaling="std",
)
This resulted in a new error: The model did not return a loss from the inputs, only the following keys: prediction_outputs,last_hidden_state. For reference, the inputs it received are past_values.
Dataset Description: My dataset consists of 1430 trading days, each with 24 feature vectors, one time vector, and one label vector. The dataset is split into training (60%), validation (20%), and test (20%) sets.
Code Snippet: I have provided the complete code snippet and data processing logic in my initial issue description.
Nature of the Problem: I am unsure whether this issue is due to the PatchTSMixerForTimeSeriesClassification
model itself, an error in dataset construction, or a misconfiguration in the model setup.
I would greatly appreciate your help in identifying the root cause of this problem and finding a solution. If you need any additional information or have any suggestions, please let me know. I would be very grateful for any further guidance or assistance.
Thank you!
in the code:
train_dataset = ForecastDFDataset(
data=train_processed,
conditional_columns=input_columns,
timestamp_column=timestamp_column,
context_length=context_length,
target_columns=[label],
prediction_length=prediction_length
)
you should change "ForecastDFDataset" to something else. Since they did not make a classification dataset, you can check here: https://github.com/ibm-granite/granite-tsfm/issues/17
Pinging @kashif here
System Info
Who can help?
@kashif
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
I am attempting to use PatchTSMixerForTimeSeriesClassification for time series classification. My input data for each day includes 24 feature vectors, plus one time vector and one label vector. The total dataset comprises 1430 trading days, divided into three subsets with a 6:2:2 split for training, validation, and testing respectively.
I am training the model over periods of 30 trading days. During training, I encounter the following error: mat1 and mat2 shapes cannot be multiplied (1x18000 and 17280x3). I would like to determine whether this issue is related to the PatchTSMixerForTimeSeriesClassification itself, an error in dataset construction, or a misconfiguration in the model setup. If it’s related to how the dataset is constructed or how the model is configured, how should I adjust it?
Here is the code snippet:
the console print: 2024-05-02 16:07:15,385 - INFO - Starting model training. 0%| | 0/82800 [00:00<?, ?it/s]An error occurred during training: mat1 and mat2 shapes cannot be multiplied (1x18000 and 17280x3)
When I modified the PatchTSMixerConfig as shown below, I encountered a new error.
模型配置