Skip to main content
GanitML
Free · no sign-up

The math behind machine learning, made for developers

Linear algebra, calculus, probability and statistics, taught the way you learn to code: drag the picture, run the NumPy, then see where it's used in real models.

3 free lessons of about 15 minutes each. Python runs in your browser.

See it, Code it, Use it

Every lesson goes from a picture you can drag, through the definitions and proofs, to NumPy code and where the idea shows up in real models. Here is cosine similarity in three steps.

  1. See it

    Drag the arrows. Cosine similarity is 1 when two vectors point the same way, 0 at right angles and −1 when they point in opposite directions. Their lengths don't matter.

  2. Code it

    The same number in NumPy, for the starting arrows. Lessons have cells like this that run Python right in the page, with nothing to install.

    import numpy as np
    
    q = np.array([2.0, 1.0])  # query
    b = np.array([1.0, 3.0])  # movie
    
    cosine = q @ b / (np.linalg.norm(q) * np.linalg.norm(b))
    print(round(cosine, 2))

    Output: 0.71

  3. Use it

    Semantic search and recommendation systems turn queries and items into vectors called embeddings, then rank the results by cosine similarity.

    Build a tiny movie search in lesson 1

The course track

Start with the tour, then go as deep as you need. Every course is free and pairs proofs with code, at the level of a university course.

Covers the complete GATE DA math syllabus

  1. C0: The Math Behind Neural Networks: A Guided Tour

    A fast, visual tour of the math inside a neural network: vectors, matrices, derivatives and gradient descent, ending with a tiny network you train in the browser.

    3 of 5 lessons live5 lessons · about 3 hours
  2. C1: Linear Algebra for ML

    Vectors, matrices, linear systems, eigenvalues and the SVD, from geometric intuition to proofs, ending in least squares and PCA.

    Coming soon36 lessons · about 40 hours
  3. C2: Calculus & Optimization for ML

    Derivatives, Taylor series, integrals and multivariable calculus, through backpropagation and the optimisers that train every model.

    Coming soon37 lessons · about 42 hours
  4. C3: Probability & Statistics for ML

    Probability, random variables, distributions, inference and information theory: the reasons behind every ML loss function.

    Coming soon37 lessons · about 42 hours
  5. C4: Machine Learning from First Principles

    Derive, implement from scratch and evaluate the classical ML algorithms, from linear regression to neural networks and clustering.

    Coming soon34 lessons · about 42 hours

Email me when new lessons are out

GanitML is a free learning project: every lesson is open to everyone, with no account needed and nothing to pay. New lessons come out a few at a time. Leave your email and we'll tell you when the next ones are out.

We'll only email you about new lessons.