How to setup audio data for audio classification task using lstm?
for example this is the setup for image data for image classification task ,like this how do i setup my data for audio classification,please help.
import torch
from torch import nn
import torchvision
from torchvision import transforms
train_transforms = transforms.Compose([
transforms.Resize(size=(224,224)),
transforms.RandomHorizontalFlip(),
transforms.RandomRotation(10),
transforms.TrivialAugmentWide(num_magnitude_bins=31),
transforms.ToTensor(),
])
test_transforms = transforms.Compose([
transforms.Resize(size=(224,224)),
transforms.RandomHorizontalFlip(),
transforms.RandomRotation(10),
transforms.ToTensor(),
])from torchvision import datasets
train_data = datasets.ImageFolder(
root=train_dir,
transform=train_transforms
)
test_data = datasets.ImageFolder(
root=test_dir,
transform=test_transforms
)from torch.utils.data import DataLoader
train_dataloader = DataLoader(
dataset = train_data,
batch_size = 28,
num_workers = os.cpu_count(),
shuffle=True
)
test_dataloader = DataLoader(
dataset = test_data,
batch_size=28,
num_workers = os.cpu_count(),
shuffle=False
)