Potato-Disease-Classfication / data_splitter.py
hassaanik's picture
Upload 324 files
32c431e verified
raw
history blame
324 Bytes
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])