Learn practical skills, build real-world projects, and advance your career

VGG 16 Architecture

Fig-A1-The-standard-VGG-16-network-architecture-as-proposed-in-32-Note-that-only.png

Data Loading

import matplotlib.pyplot as plt
import numpy as np

import torch
import torchvision
import torchvision.transforms as transforms
import torch.nn as nn
import torch.optim as optim
import time
transform_train = transforms.Compose([
    transforms.RandomResizedCrop(224), 
    transforms.ToTensor(),
    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
    ])

transform_test = transforms.Compose([
    transforms.RandomResizedCrop(224), 
    transforms.ToTensor(),
    transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
    ])
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
print(device)
cuda:0