Skip to content
Hugo Gómez.

Mathematics + Code

Interactive visualisations of dynamic systems, machine learning and signal analysis — mathematics running in the browser.

Gradient descent, live

Gradient descent minimises a function by stepping against its gradient. Tweak the learning rate (η) and the starting point to watch it converge — or diverge.

xn+1=xn−η f′(xn),f(x)=(x−1)2+0.5x_{n+1} = x_n - \eta\, f'(x_n), \quad f(x) = (x-1)^2 + 0.5
min

n = 0 · x = -3.0000 · f(x) = 16.5000 · click the chart to set x₀

Fourier series of a square wave

A square wave is approximated by summing odd harmonics. Increase the number of terms and watch the sum converge to the target signal (with Gibbs ringing at the jumps).

f(x)=4π∑k=1nsin⁡((2k−1)x)2k−1f(x) = \frac{4}{\pi} \sum_{k=1}^{n} \frac{\sin((2k-1)x)}{2k-1}

Lorenz Attractor

Chaotic dynamical system described by three ODEs. Change σ or ρ to explore the bifurcation: below ρ ≈ 24.7 the system converges to a fixed point; above, chaos emerges.

x˙=σ(y−x),  y˙=x(ρ−z)−y,  z˙=xy−83z\dot x=\sigma(y{-}x),\;\dot y=x(\rho{-}z){-}y,\;\dot z=xy{-}\tfrac{8}{3}z

ρ < 24.7 → fixed point · ρ > 24.7 → chaos

Interactive neural classifier

2→8→1 network (ReLU + sigmoid). Left-click to add class-A points, right-click for class B. The network trains in real time and draws the live decision boundary.

Class A (left)Class B (right)

Click the canvas to add points — training starts automatically.