Tivadar Danka Profile picture
Feb 10 8 tweets 3 min read Read on X
How to build a good understanding of math for machine learning?

I get this question a lot, so I decided to make a complete roadmap for you. In essence, three fields make this up: calculus, linear algebra, and probability theory.

Let's take a quick look at them! Image
1. Linear algebra.

In machine learning, data is represented by vectors. Essentially, training a learning algorithm is finding more descriptive representations of data through a series of transformations.

Linear algebra is the study of vector spaces and their transformations. Image
Simply speaking, a neural network is just a function mapping the data to a high-level representation.

Linear transformations are the fundamental building blocks of these. Developing a good understanding of them will go a long way, as they are everywhere in machine learning.
2. Calculus.

While linear algebra shows how to describe predictive models, calculus has the tools to fit them to the data.

If you train a neural network, you are almost certainly using gradient descent, which is rooted in calculus and the study of differentiation. Image
Besides differentiation, its "inverse" is also a central part of calculus: integration.

Integrals are used to express essential quantities such as expected value, entropy, mean squared error, and many more. They provide the foundations for probability and statistics.
When doing machine learning, we are dealing with functions with millions of variables.

In higher dimensions, functions work differently. This is where multivariable calculus comes in, where differentiation and integration are adapted to these spaces. Image
3. Probability theory.

How to draw conclusions from experiments and observations? How to describe and discover patterns in them? These are answered by probability theory and statistics, the logic of scientific thinking. Image
I know all of this because I spent five years writing a textbook about it. It'll be released in May, but you should preorder it now, as it's heavily discounted!

(The paperback version is currently $39.99, the final price will be $59.99 upon release.)

amazon.com/Mathematics-Ma…

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Tivadar Danka

Tivadar Danka Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @TivadarDanka

Jul 30
One of the coolest ideas in mathematics is the estimation of a shape's area by throwing random points at it.

Don't believe this works? Check out the animation below, where I show the method on the unit circle. (Whose area equals to π.)

Here is what's behind the magic:
Let's make this method precise!

The first step is to enclose our shape S in a square.

You can imagine this as a rectangular dartboard. Image
Now, we select random points from the board and count how many hit the target.

Again, you can imagine this as closing your eyes, doing a 360° spin, then launching a dart.

(Suppose that you always hit the board. Yes, I know. But in math, reality doesn't limit imagination.) Image
Read 14 tweets
Jul 29
What is common between the Fourier series and the Cartesian coordinate system?

More than you think: they are (almost) the same.

Let me explain why! Image
Let's start with the basics: the inner product.

In the Euclidean plane, it can be calculated using the "magnitude x magnitude x cosine" formula, also known as the geometric definition. Image
Now, let's project x to y!

With basic trigonometry, we can see that the inner product is related to the length of the projection. Image
Read 15 tweets
Jul 27
One of my favorite formulas is the closed-form of the geometric series.

I am amazed by its ubiquity: whether we are solving basic problems or pushing the boundaries of science, the geometric series often makes an appearance.

Here is how to derive it from first principles: Image
Let’s start with the basics: like any other series, the geometric series is the limit of its partial sums.

Our task is to find that limit. Image
There is an issue: the number of terms depends on N.

Thus, we can’t take the limit term by term. Image
Read 13 tweets
Jul 26
Matrices + the Gram-Schmidt process = magic.

This magic is called the QR decomposition, and it's behind the famous eigenvalue-finding QR algorithm.

Here is how it works: Image
In essence, the QR decomposition factors an arbitrary matrix into the product of an orthogonal and an upper triangular matrix.

(We’ll illustrate everything with the 3 x 3 case, but everything works as is in general as well.)
First, some notations:

Every matrix can be thought of as a sequence of column vectors.

Trust me, this simple observation is the foundation of many-many Eureka moments in mathematics. Image
Read 13 tweets
Jul 25
Summing numbers is more exciting than you think.

For instance, summing the same alternating sequence of 1s and (-1)s can either be zero or one, depending on how we group the terms. What's wrong?

I'll explain. Enter the beautiful world of infinite series. Image
Let’s go back to square one: the sum of infinitely many terms is called an infinite series. (Or series in short.)

Infinite series form the foundations of mathematics. Image
Do infinite series make sense? Sure.

Take a look at the geometric series: summing the positive powers of 1/2 adds up to one.

Here is a visual proof to convince you. Image
Read 24 tweets
Jul 24
I have spent at least 50% of my life studying, practicing, and teaching mathematics.

The most common misconceptions I encounter:

• Mathematics is useless
• You must be good with numbers
• You must be talented to do math

These are all wrong. Here's what math is really about: Image
Let's start with a story.

There’s a reason why the best ideas come during showers or walks. They allow the mind to wander freely, unchained from the restraints of focus.

One particular example is graph theory, born from the regular daily walks of the legendary Leonhard Euler.
Here is the map of Königsberg (now known as Kaliningrad, Russia), where these famous walks took place.

This part of the city is interrupted by several rivers and bridges.

(I cheated a little and drew the bridges that were there in Euler's time, but not now). Image
Read 17 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us!

:(