= 16
bs = 7 # aka channels, features, variables, dimensions
c_in = 2
c_out = 15
seq_len = torch.randn(bs, c_in, seq_len).to(default_device())
xb
= ROCKET(c_in, seq_len, n_kernels=1_000, kss=[7, 9, 11]) # 1_000 for testing with a cpu. Default is 10k with a gpu!
m 2_000]) test_eq(m(xb).shape, [bs,
ROCKET Pytorch
ROCKET (RandOm Convolutional KErnel Transform) functions for univariate and multivariate time series developed in Pytorch.
ROCKET
ROCKET (c_in, seq_len, n_kernels=10000, kss=[7, 9, 11], device=None, verbose=False)
RandOm Convolutional KErnel Transform
ROCKET is a GPU Pytorch implementation of the ROCKET functions generate_kernels and apply_kernels that can be used with univariate and multivariate time series.
create_rocket_features
create_rocket_features (dl, model, verbose=False)
Args: model : ROCKET model instance dl : single TSDataLoader (for example dls.train or dls.valid)
from tsai.data.all import *
from tsai.models.utils import *
= get_UCR_data('OliveOil', split_data=False)
X, y, splits = [None, TSRegression()]
tfms = TSStandardize(by_var=True)
batch_tfms = get_ts_dls(X, y, splits=splits, tfms=tfms, batch_tfms=batch_tfms, shuffle_train=False, drop_last=False)
dls = build_ts_model(ROCKET, dls=dls, n_kernels=1_000) # 1_000 for testing with a cpu. Default is 10k with a gpu!
model = create_rocket_features(dls.train, model)
X_train, y_train = create_rocket_features(dls.valid, model)
X_valid, y_valid X_train.shape, X_valid.shape
((30, 2000), (30, 2000))