A lot in machine learning is pretty dry and boring, but understanding how autoencoders work feels different.
This is a thread about autoencoders, things they can do, and a pretty cool example.
↓ 1/10
Autoencoders are lossy data compression algorithms built using neural networks.
A network encodes (compresses) the original input into an intermediate representation, and another network reverses the process to get the same input back.
↓ 2/10
The encoding process "generalizes" the input data.
I like to think of it as the Summarizer in Chief of the network: its entire job is to represent the entire dataset as compactly as possible, so the decoder can do a decent job at reproducing the original data back.
↓ 3/10
Autoencoders are very useful to detect anomalies in the data.
Any uncommon characteristics in the input data will never make it past the autoencoder’s bottleneck.
The autoencoder has to be very picky at which features it learns. It will throw away anything uncommon.
↓ 4/10
For example, let's train an autoencoder with pictures of bananas.
The autoencoder will get really good at reproducing the original picture back because it’s learned how to represent them.
What would happen if you show the autoencoder a rotten banana instead?
↓ 5/10
Well, the autoencoder didn’t learn to represent rotten bananas, so the decoder will never be able to reproduce it back correctly.
The result will look like a ripe banana because that’s all the information the decoder had 🤷♂️.
↓ 6/10
Now, you can take the original image and compute the difference with the output.
If the difference is small, there's no anomaly. If the difference is large, the autoencoder couldn't reproduce the original image, which means there's an anomaly.
↓ 7/10
Autoencoders aren't only useful to detect anomalies.
What would happen if we teach an autoencoder to transform the input image into something else?
↓ 8/10
For example, we could teach an autoencoder to remove noise from pictures by showing it images with noise and expecting back their corresponding clean version.
Here, the encoder will develop an intermediate representation that helps the decoder produce clean pictures.
↓ 9/10
After we train this autoencoder, we can remove noise from any picture similar to the input dataset!
If you are looking for more, this course from Harvard University is an excellent introduction to probability as a language and a set of tools for understanding statistics, science, risk, and randomness.
We usually talk about two main types of machine learning models:
• A Classification model
• A Regression model
They are different, and it's essential to understand why.
↓ 1/6
Whenever the result of your predictions is categorical, you have a classification model.
For example, when your prediction is a binary value (True or False,) or when you want to predict a specific animal from a picture (Lion, Zebra, Horse.)
↓ 2/6
If the result of your predictions is numerical, you have a regression model.
For example, returning a stock's future price, the value of a house, or tomorrow's temperature.
Here are my thoughts about the "HTML is not a programming language" recurrent theme.
↓ 1/5
This question is controversial not because people care about HTML but because it is used as a proxy to classify their worth.
If HTML is not a programming language, then the people working with HTML must not be real programmers, right?
↓ 2/5
This is demeaning and completely unhelpful for those who are starting and looking to find a community.
Instead of drawing lines, we should be welcoming those who want to join us. We need more programmers, coders, developers, or whatever else you want to call them!