File size: 324 Bytes
32c431e
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
from torch.utils.data import random_split
from data_transformer import dataset

# Define the sizes of the train and validation sets
train_size = int(0.8 * len(dataset))
val_size = len(dataset) - train_size

# Split the dataset into train and validation sets
train_set, val_set = random_split(dataset, [train_size, val_size])