Prashant Profile picture
Apr 14, 2021 9 tweets 3 min read Read on X
Convolutions! 1D! 2D! 3D!🔲

I've had a lot of trouble understanding different convolutions
What do different convolutions do anyway❓

Without the correct intuition, I found defining any CNN architecture very unenjoyable.

So, here's my little understanding (with pictures)🖼👇
The Number associated with the Convolution signifies two things:
🔸The number of directions the filter moves in and,
🔸The dimensions of the output

Each convolution expects different shapes of inputs and results in output equal to the dimensions it allows the filter to move in.
In 1⃣D-Conv, the kernel moves along a single axis.
It is generally applied over the inputs that also vary along a single dimension, ex: electric signal.

The input could be a 1D array and a small 1D kernel can be applied over it to get another 1D array as output.
And... it can also be applied on two-dimensional inputs. How?

Remember, 1D convolution does not mean the kernel has to be 1D.
We can match the additional dimension of the input to that of the kernel.

If we have 20x8 image we can make a kernel of 3 to 3x8, output is still 1D.
In 2⃣D-Conv, the kernel moves along two axes (x,y).
It is generally applied over the inputs which are also 2 dimensional, like a grayscale image (single channel)

The input is a 2D array and a 2D kernel is applied to get another 2D matrix as output.
And yes, 2D convolutions can also be applied to a higher dimensional input like 3D.
The principle remains the same of matching the additional dimension with kernel depth.

an input of 28x28x6 can be slid over by a 3x3 kernel by making it 3x3x6.
In 3⃣D-Conv, the kernel moves along three axes (x,y,z).
It is applied over 3-dimensional inputs

The input is a 3D array and a 3D kernel is applied to get another 3D cuboid-like output.

But the kernel depth must be less than the input depth to make sure we get 3D output.
These points helped me build my intuitions of convolutions.

This definitely helps in understanding how to add or remove layers from a convolutional architecture properly.
In the next thread, we will try to understand the shapes and calculating them correctly.

And maybe with little Keras code snippets as well!

Hope this helps! 👍

• • •

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

Keep Current with Prashant

Prashant 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 @capeandcode

Feb 24, 2023
How ChatGPT Works?

• Everyone knows about ChatGPT but not everyone is aware of how it works.

Here is an attempt at explanation ↓

[ In 10 Steps ]
• It is a large language model based which uses a technique called "transformer" to understand and generate human-like responses to text-based input.

• Transformer is a neural network architecture that excels at processing sequential data, such as text.
• The model is trained on a massive amount of text data from a wide range of sources, such as books, articles, and websites.

• These resources allow the model to learn patterns and relationships in language.
Read 12 tweets
Sep 22, 2022
"Learn SQL"

Great advice no doubt.

• But what topics to cover?
• Which SQL database to use?
• What resources to learn from?

Here's is a track you can follow ↓

1/22
Let's start with choosing the SQL database to learn.

• There are several of databases like Postgres, MS SQL server, MS Access, Oracle.

• But for learning purposes I'd suggest going with MySQL.

• For reasons that it is secure, free & open source and the support is great.
• Later on we can switch to other databases easily.

• Now what topic should we know in SQL? I knew the basics like select, where and joins but I couldn't get past them.

• So here are some topics and terms everyone should learn, starting with...
Read 23 tweets
Sep 14, 2022
Interview Question:

• What is Covariance?
• What is Correlation?

• What are the differences between them?

Explain briefly ↓

0/9
COVARIANCE

• Covariance tells us the systematic relationship between two random variables, in which a change in one reflects the change in other.

• It measures the joint variability of two random variables.

• The formula for covariance is:

1/9
• It has a range of [-∞, +∞].

• The greater the covariance, the more reliant the relationship.

• The covariance value isn't very easy to interpret and depends on the context.

2/9
Read 11 tweets
Sep 12, 2022
Interview Questions

• How does k-means work?
• What are its stopping criteria?
• What are its pros and cons?
• How do you choose its number of clusters?

Explain briefly ↓

0/4 Image
1. Working

• k-means is an unsupervised algorithm.

• We want to create groups of similar data points using this algorithm.
• In k-means we begin with a set of random points as clusters.

• We measure the distance of each point from the clusters using some distance metric like euclidean or cosine.

• We assign points to the cluster that is closest to it.
Read 11 tweets
Sep 2, 2022
Another common interview question

• What are the assumptions of Linear Regression?
• How do we check them?
• How can we fix them?

Here's the answer ↓

0/5
1. Linear Relationship

It is assumed that the relationship between the dependent and independent variables is linear.
!How to check:

• Observe the Residuals vs Fitted Value plots, there shouldn't be any evident pattern.
Read 17 tweets
Aug 31, 2022
Random Forests is a favorite for interviews!

By far the most common questions that I have been asked are one way or other related to Random Forests

It's important to know it inside out.

Here's are some of those questions:

0/8
Q: What ensemble principle is used in Random Forests?

A: Random Forest works on the principle of the bagging ensemble technique.

Bagging stands for Bootstrap Aggregation.
In Bagging, random data samples in a training set are used with replacement.

1/9
Q: Do Random Forests require pruning?

A: Random Forests usually do not require pruning as they don't overfit like a single DT as trees are bootstrapped and multiple random trees use random features so the individual trees are strong predictors without being correlated.

2/9
Read 15 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!

:(