optimization
5 lessons tagged optimization: free, quiz-checked micro-lessons.
Training: Optimization and Regularization
Go from a raw neural network to one that actually generalizes. Covers loss functions (MSE, cross-entropy), gradient descent variants (SGD, momentum, Adam), learning-rate effects, overfitting vs underfitting, and the regularization toolkit (L2/dropout/early stopping/batch norm).
IR, Optimization, and Code Generation
The typed AST is high-level — too high for a CPU. Learn why compilers lower to an intermediate representation first, what SSA form buys you, how classic optimizations (constant folding, dead-code elimination, CSE) transform IR, and how instruction selection and register allocation finally produce machine code.
Lagrangian Duality: From Primal to Dual
Every constrained optimization problem has a twin. Learn how to build the Lagrangian, derive the dual problem, and use weak duality, strong duality, and the KKT conditions to certify optima — with worked examples from linear programming and SVMs.
Profiling CUDA: Occupancy, Memory Coalescing, and Nsight
A working CUDA kernel is the start, not the finish. How to measure occupancy, spot uncoalesced loads and warp divergence, and read the three numbers in Nsight Compute that actually matter.
Shared Memory Tiling for Matrix Multiplication
Why naive matmul on a GPU is bandwidth-starved, and how tiling with __shared__ memory reduces global memory traffic by a factor of the tile size. The classic optimisation, with the kernel that demonstrates it.
