timeseriesAI / tsai

Time series Timeseries Deep Learning Machine Learning Python Pytorch fastai | State-of-the-art Deep Learning library for Time Series and Sequences in Pytorch / fastai
https://timeseriesai.github.io/tsai/
Apache License 2.0
5.07k stars 633 forks source link

MiniRocketPlus ValueError: Expected input batch_size (256) to match target batch_size (512) #664

Closed Zwayeh closed 1 year ago

Zwayeh commented 1 year ago

I am having an issue getting MiniRocketPlus to work with multivariant data.

#Create dataset
X, y = df2xy(PDCTAC1, target_col='target', feat_col='feature', sample_col='sample')
#Check size
test_eq(X.shape, (600, 2, 6541))
test_eq(y.shape, (600, 2))
#Generate train/valid splits
splits = get_splits(y, valid_size=.2, stratify=True, random_state=23, shuffle=True)

#Create dataloaders and attempt to train MiniRocketPlus
tfms = [None, TSClassification()]
batch_tfms = TSStandardize()
dls = get_ts_dls(X, y, splits=splits, tfms=tfms, batch_tfms=batch_tfms, bs=256)
learn = ts_learner(dls, MiniRocketPlus, kernel_size=7, metrics=accuracy)
learn.fit_one_cycle(1, 1e-2)

When y has more than one dimension, I receive an error: _ValueError: Expected input batch_size (256) to match target batchsize (512).

I can see the values from the error are created by the 'bs' variable in my dls dataloader, and this value multiplied by the number of features in my dataset.

oguiza commented 1 year ago

Please, do not post issues that have been previously discussed by email.