As you know, I am working on teaching mathematics in a way that maximizes value for machine learning practitioners.

Do you have any work stories where mathematical knowledge was a genuine advantage?

I would appreciate it if you could share!

I'll start. ↓
As a bioimage analyst, one of my projects involved the pixel-perfect identification of very thin objects: plant seedlings. (Like below.)

This was a classical semantic segmentation problem.

At first, I trained a UNet model using cross-entropy loss, but it didn't quite work.
The problem was that on the segmentation output, objects were not defined at all. My model predicted almost every pixel as background.

With some basic mathematical thinking, I suspected that the problem is caused by the cross-entropy loss.
See, if the vast majority of ground truth pixels belong to the background, cross-entropy loss is small when all pixels are actually predicted as background.

So, I started to look for loss functions that are more sensitive to rare classes.
Again, my mathematical intuition suggested that measuring something like the average overlap ratio per class should work.

Since I knew what I looking for, a quick research gave me what I needed: the Dice loss. (Cool article below if you are interested.)

medium.com/ai-salon/under…
With the Dice loss, my model started to work, and eventually, we solved the problem.

You can see the result below. This was the predicted class label map for one of our test images.
(Our work was published in an academic journal, check it out if you are interested. It is open access, so you can read it for free.)

academic.oup.com/plphys/article…
I have many stories like this, but now I would love to hear some from you!

Was math ever an advantage for you? Or you never really used it, always wondering why it is taught for machine learning practitioners?

Let me know!

• • •

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

5 Oct
There is one big reason we love the logarithm function in machine learning.

Logarithms help us reduce complexity by turning multiplication into addition. You might not know it, but they are behind a lot of things in machine learning.

Here is the entire story.

🧵 👇🏽 Image
First, let's start with the definition of the logarithm.

The base 𝑎 logarithm of 𝑏 is simply the solution of the equation 𝑎ˣ = 𝑏.

Despite its simplicity, it has many useful properties that we take advantage of all the time. Image
You can think of the logarithm as the inverse of exponentiation.

Because of this, it turns multiplication into addition. Exponentiation does the opposite: it turns addition into multiplication.

(The base is often assumed to be a fixed constant. Thus, it can be omitted.) Image
Read 8 tweets
30 Sep
🤔 Should you learn mathematics for machine learning?

Let's do a thought experiment! Imagine moving to a new country without speaking the language and knowing the way of life. However, you have a smartphone and a reliable internet connection.

How do you start exploring?

1/8
With Google Maps and a credit card, you can do many awesome things there: explore the city, eat in nice restaurants, have a good time.

You can do the groceries every day without speaking a word: just put the stuff in your basket and swipe your card at the cashier.

2/8
After a few months, you'll start to pick up some language as well—simple things, like saying greetings or introducing yourself. You are off to a good start!

There are built-in solutions for common tasks that just work. Food ordering services, public transportation, etc.

3/8
Read 8 tweets
29 Sep
I just released a new chapter for the early access of my book, the Mathematics of Machine Learning!

This week, we are diving deep into the geometry of matrices.

What does this have to do with machine learning? Read on to find out. ↓

tivadar.gumroad.com/l/mathematics-…
Matrices are the basic building blocks of learning algorithms.

Multiplying the data vectors with a matrix is equivalent to transforming the feature space. We think about this as a "black box", but there is a lot to discover.

For one, how they change the volume of objects.
This is described by the determinant of the matrix, which is given by

• how the transformation scales the volume,
• and how it changes the orientation of basis vectors.

The determinant is given by the formula below. I am a mathematician, and even I find this intimidating.
Read 5 tweets
21 Sep
You don't need to go to a university to learn machine learning - you can do it from your living room, for completely free.

Here is an extensive list of curated free courses and tutorials, from beginner to advanced. ↓

(Trust me, you want to bookmark this tweet.)
This is how I'll group the courses.

Machine learning
├── Getting started
├── Computer vision
├── NLP
├── Reinforcement learning
└── Applications

Coding
├── Python
├── R
├── Javascript
└── Machine learning frameworks

Let's start!
Machine learning
└── Getting started

1. Neural networks (by @3blue1brown)

youtube.com/playlist?list=…
Read 40 tweets
20 Sep
What do you get when you let a monkey randomly smash the buttons on a typewriter?

Hamlet from Shakespeare, of course. And Romeo and Juliet. And every other finite string that is possible.

Don't believe me? Keep reading. ↓
Let's start at the very beginning!

Suppose that I have a coin that, when tossed, has a 1/2 probability of coming up heads and a 1/2 probability of coming up tails.

If I start tossing the coin and tracking the result, what is the probability of 𝑛𝑒𝑣𝑒𝑟 having heads?
To answer this, first, we calculate the probability of no heads in 𝑛 tosses. (That is, the probability of 𝑛 tails.)

Since tosses are independent of each other, we can just multiply the probabilities for each toss together.
Read 14 tweets
16 Sep
Data similarity has such a simple visual interpretation that it will light all the bulbs in your head.

The mathematical magic tells you that similarity is given by the inner product. Have you thought about why?

This is how elementary geometry explains it all.

↓ A thread. ↓
Let's start in the beginning!

In machine learning, data is represented by vectors. So, instead of observations and features, we talk about tuples of (real) numbers.
Vectors have two special functions defined on them: their norms and inner products. Norms simply describe their magnitude, while inner products describe
.
.
.
well, a 𝐥𝐨𝐭 of things.

Let's start with the fundamentals!
Read 11 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

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

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(