Neural Networks 101
A neural network is a computational model inspired by the brain's structure.
Architecture
- Input layer: Receives raw data
- Hidden layers: Transform data through weighted connections
- Output layer: Produces predictions
Key Concepts
- Weights are adjusted during training
- Activation functions (ReLU, sigmoid) add non-linearity
- Backpropagation computes gradients for optimization
import torch.nn as nn
model = nn.Sequential(
nn.Linear(784, 128),
nn.ReLU(),
nn.Linear(128, 10)
)