Santiago 🎃 Profile picture
13 Oct, 10 tweets, 3 min read
Transfer Learning.

It sounds fancy because it is.

This is a thread about one of the most powerful tools that make possible that knuckleheads like me achieve state-of-the-art Deep Learning results on our laptops.

🧵👇
Deep Learning is all about "Deep" Neural Networks.

"Deep" means a lot of complexity. You can translate this to "We Need Very Complex Neural Networks." See the attached example.

The more complex a network is, the slower it is to train, and the more data we need to train it.

👇
To get state-of-the-art results when classifying images, we can use a network like ResNet50, for example.

It takes around 14 days to train this network with the "imagenet" dataset (1,300,000+ images.)

14 days!

That's assuming that you have a decent (very expensive) GPU.

👇
This, of course, is out of reach for people like you and me. We wouldn't be able to afford the cost of constantly experimenting with deep networks.

Cost and time are both ridiculous.

Thankfully, we don't have to. We have "Transfer Learning."

👇
Let's get the boring definition out of the way:

▫️Transfer learning is a method where we can reuse a model that was developed for one task as the starting point for another task.

What does this mean?

We don't need to train our huge deep network from scratch!

👇
Imagine we want to build a model to recognize a few animal species.

To get decent results, we'd need to train that model with thousands (millions) of images. Just think about all the information that's packed on an image! There's no way to learn without many, many images.

👇
Thanks to Transfer Learning we don't have to!

ResNet50 was trained on 1.3M images, right? These images are not only animals, but they are a good representation of the world.

After training, ResNet50 knows about shapes, colors, shadows, lines, borders, etc.

👇
All of that information is already encoded in that model and we don't need to learn it again.

Instead, we can use that model, modify its output, and train a portion of it to learn the specific animal species from our dataset.

We will be "inheriting" all its knowledge.

👇
This concept is extremely powerful.

Today, we have big organizations training these base models with huge datasets, and the rest of the industry can simply transfer all of that knowledge and focus on more specific problems.

We don't need 14 days to train anymore!

👇
Throughout this thread, I used ResNet50 as an example. Here are more architectures:

▫️Inception
▫️VGG
▫️NasNet
▫️Xception
▫️MobileNet
▫️EfficientNet
▫️DenseNet

I'm curious to hear about your experience. How are you taking advantage of Transfer Learning in your work?

• • •

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

Keep Current with Santiago 🎃

Santiago 🎃 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 @svpino

14 Oct
Machine Learning 101:

▫️ Overfitting sucks ▫️

Here is what you need to know.

🧵👇 Image
Overfitting is probably the most common problem when training a Machine Learning model (followed very close by underfitting.)

Overfitting means that your model didn't learn much, and instead, it's just memorizing stuff.

👇
Overfitting may be misleading: during training, it looks like your model learned awesomely well.

Look at the attached picture. It shows how the accuracy of a sample model increases as it's being trained.

The accuracy reaches close to 100%! That's awesome!

Or, is it?

👇 Image
Read 9 tweets
12 Oct
When I heard about Duck Typing for the first time, I had to laugh.

But Python 🐍 has surprised me before, and this time was no exception.

This is another short thread 🧵 that will change the way you write code.

👇
Here is the idea behind Duck Typing:

▫️If it looks like a duck, swims like a duck, and quacks like a duck, then it probably is a duck.

Taking this to Python's world, the functionality of an object is more important than its type. If the object quacks, then it's a duck.

👇
Duck Typing is possible in dynamic languages (Hello, JavaScript fans 👋!)

Look at the attached example. Notice how "Playground" doesn't care about the specific type of the supplied item. Instead, it assumes that the item supports the bounce() method.

👇
Read 8 tweets
11 Oct
This is ridiculous.

I've been coding in Python 🐍 since 2014. Somehow I've always resisted embracing one of their most important principles.

This is a short thread 🧵about idiomatic Python.

👇
Python is all about readability.

One of its core principles is around writing explicit code.

Explicitness is about making your intentions clear.

Take a look at the attached code. It's one of those classic examples showing bad versus good.

See the difference?

👇
There are more subtle ways in which Python encourages explicitness.

This example shows a function that checks whether two keys exist in a dictionary and adds them up if they do.

If one of the keys doesn't exist, the function returns None.

Nothing wrong here, right?

👇
Read 9 tweets
10 Oct
I had a breakthrough that turned a Deep Learning problem on its head!

Here is the story.
Here is the lesson I learned.

🧵👇
No, I did not cure cancer.

This story is about a classification problem —specifically, computer vision.

I get images, and I need to determine the objects represented by them.

I have a ton of training data. I'm doing Deep Learning.

Life is good so far.

👇
I'm using transfer learning.

In this context, transfer learning consists of taking a model that was trained to identify other types of objects and leverage everything that it learned to make my problem easier.

This way I don't have to teach a model from scratch!

👇
Read 11 tweets
8 Oct
Here is a formula for growth.

(Not the only one, but one that works.)

People follow you when they are afraid of missing out on what you have to say.

People get afraid of missing out when they meet you and have a chance to realize that they want more of you.

🧵👇 Image
Then, we can conclude that there are two steps:

1. You need to get in front of people by posting "shareable" content.

2. Once people meet you, you need to hook them so they follow you instead of moving on.

👇
In Twitter, shareable content means content that people want to engage with:

▫️They like it
▫️They leave a comment
▫️They retweet it

There are multiple ways to create shareable content that spreads quickly.

👇
Read 10 tweets
8 Oct
A real-life Machine Learning solution that works.

Here is a breakdown of every piece and how they work together.

🧵👇
There's a website.

Users upload a group of pictures of an item and select the category it belongs to.

The system returns how much money the item is worth.

👇
Before:

▫️A group of people reviewed the pictures submitted by the user and decided how much the item was worth.

Today:

▫️The system quotes some of the items automatically (some still have to go through humans for a quote.)

👇
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!