i’m zain, a math student at waterloo. i’m interested in how machine learning works, from the math behind it to what happens when you put it to use.

i like building the pieces myself and testing them against real problems.

projects

experience

  • machine learning engineering intern

    vaporvm2025

    built a retrieval component that grounds llm answers in company data, and python pipelines to clean and prepare text.

  • programming instructor

    code ninjas2023–25

    taught programming to kids, mentored a first lego league team, and wrote python exercises.

education

honours mathematics

university of waterloo 2025–

loss landscape

static view · final paths shown. keyboard: arrow keys rotate, r picks a new start, space pauses or resumes. in study view, alt and arrow keys move the probe, enter starts a run, f switches between levels and flow, and escape returns to the portfolio.

optimizer details

three optimizers train the same small network. the terrain is its loss; o marks their shared start.

optimizer losses, measured as mean squared error
markeroptimizerloss ↓result
Ggradient descent0.0035lowest
Mmomentum0.0033lowest
Aadam0.0033lowest

step 335 · best found 0.0033

f(x) = sin(w1 x) + sin(w2 x), fit to 24 fixed, noisy samples. the ground is weight space; height is proportional to the square root of mean squared error. all three use the full batch. dim trails continue behind the terrain.

gradient descent: lr=0.004; momentum: lr=0.004, momentum=0.9; adam: lr=0.03. adam uses β1=0.9, β2=0.999, ε=10⁻⁸. each run stops when all updates stay below 0.0002 for 20 steps, or at 900 steps. “lowest” means within 0.001 of the best loss found by a grid search and refinement.