from fastai.learner import *
from tsai.models.InceptionTime import *
from tsai.data.external import get_UCR_data
from tsai.data.core import get_ts_dls, TSCategorize
from tsai.data.preprocessing import TSStandardize
from tsai.learner import ts_learner
Label-mixing transforms
Callbacks that perform data augmentation by mixing samples in different ways.
MixHandler1d
MixHandler1d (alpha=0.5)
A handler class for implementing mixed sample data augmentation
MixUp1d
MixUp1d (alpha=0.4)
Implementation of https://arxiv.org/abs/1710.09412
= get_UCR_data('NATOPS', return_split=False)
X, y, splits = [None, TSCategorize()]
tfms = TSStandardize()
batch_tfms = get_ts_dls(X, y, tfms=tfms, splits=splits, batch_tfms=batch_tfms)
dls = ts_learner(dls, InceptionTime, cbs=MixUp1d(0.4))
learn 1) learn.fit_one_cycle(
epoch | train_loss | valid_loss | time |
---|---|---|---|
0 | 1.908455 | 1.811908 | 00:03 |
CutMix1d
CutMix1d (alpha=1.0)
Implementation of https://arxiv.org/abs/1905.04899
IntraClassCutMix1d
IntraClassCutMix1d (alpha=1.0)
Implementation of CutMix applied to examples of the same class
= get_UCR_data('NATOPS', split_data=False)
X, y, splits = [None, TSCategorize()]
tfms = TSStandardize()
batch_tfms = get_ts_dls(X, y, tfms=tfms, splits=splits, batch_tfms=batch_tfms)
dls = ts_learner(dls, InceptionTime, cbs=IntraClassCutMix1d())
learn 1) learn.fit_one_cycle(
epoch | train_loss | valid_loss | time |
---|---|---|---|
0 | 1.813483 | 1.792010 | 00:03 |
= get_UCR_data('NATOPS', split_data=False)
X, y, splits = [None, TSCategorize()]
tfms = TSStandardize()
batch_tfms = get_ts_dls(X, y, tfms=tfms, splits=splits, batch_tfms=batch_tfms)
dls = ts_learner(dls, cbs=CutMix1d(1.))
learn 1) learn.fit_one_cycle(
epoch | train_loss | valid_loss | time |
---|---|---|---|
0 | 1.824509 | 1.774964 | 00:04 |