tranformed =transforms.Compose([transforms.Resize((75,75)) ,
transforms.ToTensor()])
train_path =‘C:/Users/anask/Desktop/AI/NN/data/train’
test_path = ‘C:/Users/anask/Desktop/AI/NN/data/val’
train_loader=DataLoader(torchvision.datasets.ImageFolder(train_path,transform=tranformed) , batch_size= 14 , shuffle=True)
test_loader=DataLoader(torchvision.datasets.ImageFolder(test_path,transform=tranformed) , batch_size=14 ,shuffle=True)
class NN(nn.Module):
def init(self,num_classes=5):
super(NN,self).init()
self.l1=nn.Linear(37575 , 1020)
self.relu= nn.ReLU()
self.l2 = nn.Linear(255,5)
def forward(self,x):
out= x.view(x.size(0), -1)
out =self.l1(x)
out = self.relu(out)
return out