Your Cart
Loading

Machine Learning from First Principles

On Sale
$24.99
$24.99
Added to cart

Draw a digit. Watch your neural network recognize it. Know how it learned to do that.


There’s a moment when machine learning clicks. You calculate a prediction by hand, see how far it is from the right answer, and work out how a single weight should change. Then you write the Python code and watch that same idea train a model. A line of math you once skimmed past becomes something you can use.


Machine Learning from First Principles is a 71-page guide by Ahmet Duyar, founder of NEURON. It takes you from fitting your first line to training a handwritten digit classifier on MNIST. Along the way, you’ll calculate predictions, follow gradients back through a network, and learn how to investigate a model when its results surprise you.


Start with a line. See what it means to learn.


Work through linear regression by hand. Calculate a prediction, measure the error, and take a gradient descent step to see how the fit changes. Then move to logistic regression and see how a model turns a score into a probability. Follow the visual examples to see how decision trees split data and how random forests combine predictions across trees.


Follow a prediction all the way back to the weights.


Trace the forward pass through a neural network and calculate its loss. Then work backward with the chain rule to see how each weight contributes to that loss. Once you’ve followed the math, the connection to PyTorch becomes concrete. You can see what the forward pass computes, what backward() gives you, and where the optimizer changes the weights.


Train your own classifier and learn from the mistakes it makes.


Build a PyTorch model that classifies handwritten digits from 0 to 9. Follow the project from loading MNIST to evaluating predictions on held-out data. Use a confusion matrix to find which digits the model mixes up and learn where to look when training stalls or test performance falls short.


What’s inside

  • Worked calculations and annotated visuals that connect the equations to what the model actually does.
  • Exercises at three difficulty levels, from quick checks to problems that ask you to work through several steps yourself.
  • A complete MNIST project in PyTorch with guidance for training, debugging, and evaluating your model.
  • Four formula sheets to keep beside you while you solve the exercises or write the code.


Whether you’re opening your first machine learning notebook or revisiting the math behind a model you already use, you can work through the guide at your own pace.


71 pages · English digital PDF · Four formula sheets included

Read the first five pages for free, then get the complete guide for $24.99 USD.

You will get a PDF (4MB) file