How high can you score against my new @DilemmaBot at Prisoner's Dilemma? ๐Ÿ’ช

Just mention it in a tweet and it will start playing with you.

For now, I won't reveal the strategy it's playing, but I'll write about that later and will publish the code as well.
Here some explanation how the game of Prisoner's Dilemma works. The bot will be playing 10 rounds of it.

โ€ข โ€ข โ€ข

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

Keep Current with Vladimir Haltakov

Vladimir Haltakov 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 @haltakov

17 Feb
What are Convolutional Neural Networks? ๐Ÿž๏ธ โญ๏ธ โ›ฐ๏ธ

CNNs are an important class of deep artificial neural networks that are particularly well suited for images.

If you want to learn the important concepts of CNNs and understand why they work so well, this thread is for you!

๐Ÿงต๐Ÿ‘‡
What is a CNN? ๐Ÿค”

A CNN is a deep neural network that contains at least one convolutional layer. A typical CNN has a structure like this:
โ–ช๏ธ Image as input
โ–ช๏ธ Several convolutional layers
โ–ช๏ธ Several interleaved pooling layers
โ–ช๏ธ One/more fully connected layers

Example: AlexNet
A good example - AlexNet

Throughout the thread I will be giving examples based on AlexNet - this is the net architecture that arguably started the whole deep learning revolution in computer vision!

I've written more about AlexNet here:
Read 21 tweets
15 Feb
Prisoner's Dilemma ๐Ÿค”

Time for some game theory! ๐Ÿ‘จโ€๐Ÿซ

Prisoner's Dilemma (PD) is an interesting game that explains how two rational individuals may make decisions that seem irrational.

The game has lots of examples and applications in real life!

Thread ๐Ÿ‘‡
There are different examples of PD, but this is the one I like most.

You want to buy something from another person. You exchange closed bags one containing the money and one the goods.

Both you and the other person can choose to honor the deal โœ… or to give an empty bag โŒ.
If you both honor the deal โœ… โœ… (cooperate), you both gain something.

If you both exchange empty bags โŒ โŒ (defect), at least nobody loses.

If you leave the bag empty, but get a full bag โœ… โŒ, you gain a lot, while the other person is screwed.

Image source: Wikipedia Image
Read 11 tweets
10 Feb
Dealing with imbalanced datasets ๐Ÿ โš–๏ธ ๐Ÿ˜

Real world datasets are often imbalanced - some of the classes appear much more often in your data than others.

The problem? You ML model will likely learn to only predict the dominant classes.

What can you do about it? ๐Ÿค”

Thread ๐Ÿ‘‡
Example ๐Ÿšฆ

We will be dealing with a ML model to detect traffic lights for a self-driving car ๐Ÿค–๐Ÿš—

Traffic lights are small so you will have much more parts of the image that are not traffic lights.

Furthermore, yellow lights ๐ŸŸก are much rarer than green ๐ŸŸข or red ๐Ÿ”ด.
The problem โšก

Imagine we train a model to classify the color of the traffic light. A typical distribution will be:
๐Ÿ”ด - 56%
๐ŸŸก - 3%
๐ŸŸข - 41%

So, your model can get to 97% accuracy just by learning to distinguish red from green.

How can we deal with this? ๐Ÿค”
Read 13 tweets
8 Feb
Machine Learning Formulas Explained ๐Ÿ‘จโ€๐Ÿซ

This is the formula for Mean Squared Error (MSE) as defined in WikiPedia. It represents a very simple concept, but may not be easy to read if you are just starting with ML.

Read below and it will be a piece of cake! ๐Ÿฐ

Thread ๐Ÿ‘‡
The core โšซ

Let's unpack from the inside out. MSE calculates how close are your model's predictions ลถ to the ground truth labels Y. You want the error to go to 0.

If you are predicting house prices, the error could be the difference between the predicted and the actual price.
Why squared? 2๏ธโƒฃ

Subtracting the prediction from the label won't work. The error may be negative or positive, which is a problem when summing up samples.

You can take the absolute value or the square of the error. The square has the property that it punished bigger errors more.
Read 8 tweets
28 Jan
Is this formula difficult? ๐Ÿค”

This is the formula for Gradient Descent with Momentum as presented in Wikipedia.

It may look intimidating at first, but I promise you that by the end of this thread it will be easy to understand!

Thread ๐Ÿ‘‡
The Basis โ—ป๏ธ

Let's break it down! The basis is this simple formula describing an iterative optimization method.

We have some weights (parameters) and we iteratively update them in some way to reach a goal.

Iterative methods are used when we cannot compute the solution directly
Gradient Decent Update ๐Ÿ“‰

We define a loss function describing how good our model is. We want to find the weights that minimize the loss (make the model better).

We compute the gradient of the loss and update the weights by a small amount (learning rate) against the gradient.
Read 7 tweets
27 Jan
How to add new classes to your ML model? ๐Ÿ๐ŸŽ๐ŸŠ... ๐ŸŒ?

You have a large multi-class NN in production.

You discover a new important class and want to add support for it *quickly* and with *low* risk.

Example: traffic signs recognition for self-driving cars ๐Ÿ›‘๐Ÿš—

Thread ๐Ÿ‘‡
The naive approach ๐Ÿคทโ€โ™‚๏ธ

Collect examples of the new class (for example a new traffic sign), label them and retrain the whole NN.

โœ… It will probably work

โŒ It will be time consuming, especially for big models.
โŒ Risk for unintended regressions
Freezing the first layers ๐Ÿฅถ

Typical CNNs learn generic image features in the initial layers and they will likely apply to the new sign as well.

You can freeze the weights of the initial layers and only retrain the last fully connected layer(s).
Read 10 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!