ResNets for TSC
This recipe shows you how to train a ResNet for TSC tasks. ResNets are a type of deep neural network architecture widely used in computer vision problems, such as image classification or object detection. Here, you’ll learn how to use them for modeling time series data.
Getting ready
We’ll continue with the same dataset and data module as in the previous recipe:
import pandas as pd data_directory = 'assets/datasets/Car' train = pd.read_table(f'{data_directory}/Car_TRAIN.tsv', header=None) test = pd.read_table(f'{data_directory}/Car_TEST.tsv', header=None) datamodule = TSCDataModule(train_df=train, test_df=test, batch_size=8)
Let’s see how to build a ResNet and train it with PyTorch Lightning.
How to do it…
In this section, we describe the process of creating a ResNet for TSC tasks:
- Let’s start by creating a ResNet using
nn.Module
...