ARIN_7102 / preprocess_data.py
henry2024's picture
Upload 9 files
5e811f4 verified
raw
history blame
571 Bytes
# Import Libaries
from torch.utils.data import DataLoader, TensorDataset
# Map target and label data together in a tuple format
def preprocess_data(label_X, target_y):
preprocessed= TensorDataset(label_X, target_y)
return preprocessed
# Create data loaders
def dataloader(dataset, batch_size, shuffle, num_workers):
dataloader= DataLoader(dataset=dataset,
batch_size=batch_size,
shuffle= shuffle,
num_workers=num_workers,
)
return (dataloader)