Quiz 2

Computer Vision

73 words
1 min read
Python Week 1: the first filter for runtime behavior
Visual companion
Python
Type and operator map

Python Week 1: the first filter for runtime behavior

View
Revision summary

What this note is really saying

Short form

# Computer Vision [Join Discord](https://discord.gg/gE2m4Qrdqv) [Previous**Deep Learning (PyTorch)**](/notes/04-degree-electives-bsda4001-ds-ai-lab-week03-03-deep-learning-pytorch)[Next**NLP with Hugging Face**](/notes/04-degree-electives-bsda4001-ds-ai-lab-week05-05-nlp-huggingface)

Computer Vision

python
import torch
import torch.nn as nn
import torchvision
import torchvision.transforms as transforms
# Load CIFAR-10
transform = transforms.Compose([
    transforms.ToTensor(),
    transforms.Normalize((0.5,), (0.5,))
])
trainset = torchvision.datasets.CIFAR10(
    root='./data', train=True, download=True, transform=transform
)
trainloader = torch.utils.data.DataLoader(
    trainset, batch_size=32, shuffle=True
)
# Pre-trained ResNet
model = torchvision.models.resnet18(pretrained=True)
# Freeze layers
for param in model.parameters():
    param.requires_grad = False
# Replace classifier
model.fc = nn.Linear(512, 10)
Document outline

Keep your place and jump directly to a heading.

Table of Contents
System Normal // Awaiting Context

Intelligence Hub

Navigate the knowledge graph to generate context. The Hub adapts dynamically to surface backlinks, related notes, and metadata insights.