Tivadar Danka Profile picture
Aug 9 12 tweets 4 min read Read on X
Differentiation reveals much more than the slope of the tangent plane.

We like to think about it that way, but from a different angle, differentiation is the same as an approximation with a linear function. This allows us to generalize the concept.

Let's see why: Image
By definition, the derivative of a function at the point 𝑎 is defined by the limit of the difference quotient, representing the rate of change. Image
In geometric terms, the differential quotient represents the slope of the line between two points of the function's graph. Image
However, differentiation can be formulated in another way.

We can write the difference quotient as the derivative plus an error term (if the derivative exists). Image
With a bit of algebra, we obtain that around 𝑎, we can replace our function with a linear function. The derivative gives the coefficient of the 𝑥 term.

(The term 𝑜(|𝑥-𝑎|) means that it goes to 0 faster than |𝑥-𝑎|. This is called the small o notation.) Image
So, the derivative is the first-order coefficient of the best linear approximation. Why is this good for us? There are two main reasons:

1) this gives a template to explain higher-order derivatives,

2) and one can easily extend the formula for multivariable functions. Image
Let's talk about higher-order derivatives first.

Going further with the idea, we might ask, what is the second-order polynomial that best approximates our function around a given point?

It turns out that we can continue our formula with the help of the second derivative. Image
In general, we can continue this expansion indefinitely. The more terms you use, the smaller the error gets.

This is called the Taylor polynomial, one of the most powerful tools in mathematics.

I'll show you an example to see why. Image
Have you ever wondered what happens when you type in the sine of some number into a hand calculator?

Since sin is a transcendental function, it is replaced with an approximation, such as its Taylor expansion that you can see below. Image
Now let's talk about the generalization of differentiation to multiple dimensions.

How would you define the derivative of a multivariable function? The most straightforward way would be as below, but there is a problem: division is not defined for vectors. Image
However, the definition offered by the best approximating linear function can be easily generalized!

The gradient (the multivariate "derivative") is the vector that gives the best linear approximation around a given point. Image
Join 20,000+ ML practitioners who get 2 actionable emails every week to help them understand the math behind ML, make smarter decisions, and avoid costly mistakes.

Subscribe here (it’s free): thepalindrome.org

• • •

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

Aug 10
You have seen the famous bell curve hundreds of times before.

Contrary to popular belief, this is NOT a probability, but a probability density.

What are densities, and why do we need them? Read on: Image
First, let's talk about probability.

The gist is, probability is a function P(A) that takes an event (that is, a set), and returns a real number between 0 and 1.

The event is a subset of the so-called sample space, a set often denoted with the capital Greek omega (Ω). Image
Every probability measure must satisfy three conditions: nonnegativity, additivity, and the probability of the entire sample space must be 1.

These are called the Kolmogorov axioms of probability, named after Andrey Kolmogorov, who first formalized them. Image
Read 21 tweets
Aug 9
Graph theory will seriously enhance your engineering skills.

Here's why you must be familiar with graphs: Image
What do the internet, your brain, the entire list of people you’ve ever met, and the city you live in have in common?

These are all radically different concepts, but they share a common trait.

They are all networks that establish relationships between objects. Image
As distinct as these things seem to be, they share common properties.

For example, the meaning of “distance” is different for

• Social networks
• Physical networks
• Information networks

But in all cases, there is a sense in which some objects are “close” or “far”. Image
Read 14 tweets
Aug 8
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 15 tweets
Aug 8
Conditional probability is the single most important concept in statistics.

Why? Because without accounting for prior information, predictive models are useless.

Here is what conditional probability is, and why it is essential: Image
Conditional probability allows us to update our models by incorporating new observations.

By definition, P(B | A) describes the probability of an event B, given that A has occurred. Image
Here is an example. Suppose that among 100 emails, 30 are spam.

Based only on this information, if we inspect a random email, our best guess is a 30% chance of it being spam.

This is not good enough. Image
Read 10 tweets
Aug 7
Neural networks are stunningly powerful.

This is old news: deep learning is state-of-the-art in many fields, like computer vision and natural language processing. (But not everywhere.)

Why are neural networks so effective? I'll explain: Image
First, let's formulate the classical supervised learning task!

Suppose that we have a dataset D, where xₖ is a data point and yₖ is the ground truth. Image
The task is simply to find a function g(x) for which

• g(xₖ) is approximately yₖ,
• and g(x) is computationally feasible.

To achieve this, we fix a parametrized family of functions.

For instance, linear regression uses this function family: Image
Read 18 tweets
Aug 7
Matrix factorizations are the pinnacle results of linear algebra.

From theory to applications, they are behind many theorems, algorithms, and methods. However, it is easy to get lost in the vast jungle of decompositions.

This is how to make sense of them. Image
We are going to study three matrix factorizations:

1. the LU decomposition,
2. the QR decomposition,
3. and the Singular Value Decomposition (SVD).

First, we'll take a look at LU.
1. The LU decomposition.

Let's start at the very beginning: linear equation systems.

Linear equations are surprisingly effective in modeling real-life phenomena: economic processes, biochemical systems, etc. Image
Read 18 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!

:(