Levi Profile picture
Jun 4, 2023 9 tweets 3 min read Read on X
5 activation functions you should know!

🧵

1/9 Image
Yesterday we touched on activation functions, you should read that thread as well:



2/9
Activation Functions are just like any other mathematical function.

It has three elements/steps:

- Input (X-axis)
- Calculation
- Output (Y-axis)

Different activation functions do different math. Let's discuss 5 🔽

3/9
1️⃣ ReLU

ReLU is widely used due to its simplicity and effectiveness.

It returns the input value if it is positive and zero otherwise.

Usually, ReLU is the default activation function.

4/9 Image
2️⃣ Sigmoid

The sigmoid is a smooth S-shaped curve that maps the input to a value between 0 and 1.

Sigmoid can be used for learning complex decision functions since it introduces non-linearity.

It is mainly used for binary classification.

5/9 Image
3️⃣ Tanh

Tanh is similar to the Sigmoid function but maps the input to a value between -1 and 1.

6/9 Image
4️⃣ Leaky ReLU

Leaky ReLU is a variation of the ReLU function.

It introduces a small slope for negative inputs, preventing neurons from becoming completely inactive (zero).

7/9 Image
5️⃣ Softmax

Softmax is primarily used in the output layer for multi-class classification problems.

It transforms the raw outputs of the neural network into a vector of probabilities.

Softmax ensures that the sum of the output probabilities is equal to 1.

8/9 Image
That's it for today.

I hope you've found this thread helpful.

Like/Retweet the first tweet below for support and follow @levikul09 for more Data Science threads.

Thanks 😉

9/9

• • •

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

Keep Current with Levi

Levi 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 @levikul09

Apr 20, 2024
A surprising statistical result 🔽

You have tested positive for a disease.

- The test is 99% accurate.

- 1 out of 10,000 people has the disease.

What is the probability that you truly have the disease, given that you have tested positive?

Let's figure out

🧵 Image
Look at a random group of 1 million people.

Fact 2 says 1 out of 10,000 people has the disease.

In our sample, 100 people have the disease, and 999,900 are healthy. Image
Run the test on the 100 sick people.

Fact 1 says the test is 99% percent accurate.

- 99 people will be diagnosed correctly as sick.

- 1 person will be misdiagnosed as healthy. Image
Read 7 tweets
Mar 31, 2024
Weights and Biases are the engines in Neural Networks.

I will explain how they work.

🧵 Image
When data is flowing between different neurons or layers, it is not just going from A to B.

Different transformations happen to them.

These transformations are described with Weights and Biases.

Let's discuss each 🔽
1️⃣ Weight

Weights determine how important each factor is in the overall prediction.

This value will determine the influence input data has on the output product.

They work similarly as in weighted means: The input is multiplied by the weights. Image
Read 8 tweets
Mar 24, 2024
Language models need to know how similar texts or words are.

Here is how they do it:
Models usually cannot work with textual data, so we need to convert words into numbers.

This is mostly done with word embeddings. These are vector (numerical) representations of text.
Note: The embeddings are usually huge, but for simplicity now I will use a vector that contains only X and Y coordinates for words.

We have four words in this example: Apple, Banana, Cat and Dog. All of them are converted into vectors and visualized. Image
Read 8 tweets
Mar 20, 2024
5 Regression Algorithms you should know

🧵 Image
1️⃣ Linear

Linear regression is the most fundamental and widely used regression algorithm.

It assumes a linear relationship between the variables.

The goal is to find the best-fitting line that minimizes the errors between the predicted and actual values. Image
2️⃣ Polynomial

Polynomial regression allows for nonlinear relationships between variables.

It adds polynomial functions to the line equation, so it can capture more complex patterns in the data. Image
Read 8 tweets
Mar 17, 2024
10 Pandas 1-liners to start Data Analysis:
1.

This code loads a CSV file into a Pandas DataFrame.

This is usually step 1, so we can start working. Image
2.

This displays the first n rows of the DataFrame, providing a quick snapshot of the data.

Alternative: df.sample

This displays a few rows randomly from the DataFrame. Image
Read 13 tweets
Mar 15, 2024
Perceptron, the simplest Neural Network.

I explain how it works. Image
The Perceptron is a binary classifier.

It can decide if data belongs to A or B or make yes or no decisions.

The two classes are usually represented with 0 and 1. I will use this notation in this thread.
Here are the steps Perceptrons go through:

- It takes several inputs
- Apply weights and biases
- Provides output

If the result is less than or equal to 0, the output is 0.

If the result is higher than 0, the output is 1.

Let's see an example 🔽 Image
Read 9 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!

:(