1D convolution for neural networks, part 9: Stride

Brandon Rohrer · Intermediate ·📐 ML Fundamentals ·6y ago

Key Takeaways

This video covers 1D convolution for neural networks, focusing on the concept of stride and its effects on output size and computation speed. The speaker discusses how stride can be used to reduce the volume of data and speed up computations, particularly in convolutional neural networks.

Full Transcript

there's nothing that says that you have to pad there's nothing that says that your output has to be the same size as your input another option is just to start calculating convolutions once your signal completely is overlapped by your kernel and those convolutions are all valid they don't rely on any data that's outside the range of your signal ever that's a nice very safe way to make sure you get valid convolutions all throughout you don't have to make any guesses about what data to invent and the only drawback then is your output is a little shorter than your input so it in effect reduces the volume of data that you have if you're looking at a time series signal it'll chop off the beginning and end portion if you're looking at an image it'll chop off a border around the image but you're guaranteed that what you're left with is all signal and no edge artifacts another element that you can play with when doing convolution is the stride so by default convolution has a stride of 1 which means each time you shift your kernel over by just one position before calculating the next convolution value this is safe it's complete it's dense sometimes this computation is a bottleneck in whatever it is you're trying to do and you'd like to speed it up also sometimes the signal that you've sampled you've sampled much more densely than you need to and it's okay to just revisit it periodically you don't have to check it every single millisecond in that case you can skip so instead of sliding your kernel over one position you can slide it over two or three or four positions each time or even more and just calculate the convolution periodically this skip is called a stride so if you're visiting every single position that's a stride of 1 if you're skipping a position needs time that's a stride of 2 etc and the stride that you choose is based on what you know about your data how densely you expect that information that you care about to be represented and also how you plan to use the result in the case of convolutional neural networks often the input signal is much more dense than can be usefully handled by the network downstream so some type of resolution reduction happens usually this happens using pooling which we'll talk about a little bit later but another way that you can do this is by introducing a stride so that you're only calculating in the two-dimensional case you're only calculating 1/4 of the total number of convolutions by reducing your resolution by a factor of 2 in both directions and you get a reduction in resolution and a speed-up in your computation time

Original Description

Part of an 9-part series on 1D convolution for neural networks. Catch the rest at https://e2eml.school/321
Watch on YouTube ↗ (saves to browser)
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Brandon Rohrer · Brandon Rohrer · 55 of 60

1 Robot Learning with a Biologically-Inspired Brain (BECCA)
Robot Learning with a Biologically-Inspired Brain (BECCA)
Brandon Rohrer
2 BECCA talk at AGI 2011
BECCA talk at AGI 2011
Brandon Rohrer
3 Robot Learning with a Biologically-Inspired Brain (BECCA), The Sequel
Robot Learning with a Biologically-Inspired Brain (BECCA), The Sequel
Brandon Rohrer
4 BECCA listens to The Hobbit
BECCA listens to The Hobbit
Brandon Rohrer
5 Learning the building blocks of speech: BECCA extracts a hierarchy of audio features
Learning the building blocks of speech: BECCA extracts a hierarchy of audio features
Brandon Rohrer
6 BECCA listens for sound effects in The Hobbit
BECCA listens for sound effects in The Hobbit
Brandon Rohrer
7 BECCA finds movie trailers while watching the Big Bang Theory
BECCA finds movie trailers while watching the Big Bang Theory
Brandon Rohrer
8 Listening for unexpected sounds: BECCA detects anomalies in audio data
Listening for unexpected sounds: BECCA detects anomalies in audio data
Brandon Rohrer
9 Learning the building blocks of vision: BECCA extracts a spatio-temporal hierarchy of features
Learning the building blocks of vision: BECCA extracts a spatio-temporal hierarchy of features
Brandon Rohrer
10 Watching for the unexpected: BECCA detects anomalies in video data
Watching for the unexpected: BECCA detects anomalies in video data
Brandon Rohrer
11 BECCA finds a stationary target
BECCA finds a stationary target
Brandon Rohrer
12 BECCA finds a stationary target at 3X speed
BECCA finds a stationary target at 3X speed
Brandon Rohrer
13 BECCA watches the X-men and Bruce Lee
BECCA watches the X-men and Bruce Lee
Brandon Rohrer
14 BECCA plays Quidditch
BECCA plays Quidditch
Brandon Rohrer
15 BECCA chases a ball
BECCA chases a ball
Brandon Rohrer
16 BECCA chases a ball, part 2
BECCA chases a ball, part 2
Brandon Rohrer
17 Becca chases a ball, part 3
Becca chases a ball, part 3
Brandon Rohrer
18 BECCA creates features from MNIST
BECCA creates features from MNIST
Brandon Rohrer
19 How reinforcement learning works in Becca 7
How reinforcement learning works in Becca 7
Brandon Rohrer
20 Deep Learning Demystified
Deep Learning Demystified
Brandon Rohrer
21 How Data Science Works
How Data Science Works
Brandon Rohrer
22 How Convolutional Neural Networks work
How Convolutional Neural Networks work
Brandon Rohrer
23 How Bayes Theorem works
How Bayes Theorem works
Brandon Rohrer
24 How Deep Neural Networks Work
How Deep Neural Networks Work
Brandon Rohrer
25 Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM)
Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM)
Brandon Rohrer
26 How Support Vector Machines work / How to open a black box
How Support Vector Machines work / How to open a black box
Brandon Rohrer
27 How autocorrelation works
How autocorrelation works
Brandon Rohrer
28 Getting closer to human intelligence through robotics
Getting closer to human intelligence through robotics
Brandon Rohrer
29 A minimalist's guide to slicing and indexing pandas DataFrames
A minimalist's guide to slicing and indexing pandas DataFrames
Brandon Rohrer
30 How decision trees work
How decision trees work
Brandon Rohrer
31 Data scientist archetypes
Data scientist archetypes
Brandon Rohrer
32 How to use python's datetime package
How to use python's datetime package
Brandon Rohrer
33 How optimization for machine learning works, part 1
How optimization for machine learning works, part 1
Brandon Rohrer
34 How optimization for machine learning works, part 2
How optimization for machine learning works, part 2
Brandon Rohrer
35 How optimization for machine learning works, part 3
How optimization for machine learning works, part 3
Brandon Rohrer
36 How optimization for machine learning works, part 4
How optimization for machine learning works, part 4
Brandon Rohrer
37 How convolutional neural networks work, in depth
How convolutional neural networks work, in depth
Brandon Rohrer
38 How to pick a machine learning model 4: Splitting the data
How to pick a machine learning model 4: Splitting the data
Brandon Rohrer
39 How to pick a machine learning model 3: Choosing a loss function
How to pick a machine learning model 3: Choosing a loss function
Brandon Rohrer
40 How to pick a machine learning model 2: Separating signal from noise
How to pick a machine learning model 2: Separating signal from noise
Brandon Rohrer
41 How to pick a machine learning model 1: Choosing between models
How to pick a machine learning model 1: Choosing between models
Brandon Rohrer
42 How to pick a machine learning model 5: Navigating assumptions
How to pick a machine learning model 5: Navigating assumptions
Brandon Rohrer
43 What do neural networks learn?
What do neural networks learn?
Brandon Rohrer
44 Interview with iRobot's Director of Data Science Angela Bassa
Interview with iRobot's Director of Data Science Angela Bassa
Brandon Rohrer
45 How Backpropagation Works
How Backpropagation Works
Brandon Rohrer
46 Evolutionary Powell's method: A discrete optimizer for hyperparameter optimization
Evolutionary Powell's method: A discrete optimizer for hyperparameter optimization
Brandon Rohrer
47 1D convolution for neural networks, part 1: Sliding dot product
1D convolution for neural networks, part 1: Sliding dot product
Brandon Rohrer
48 1D convolution for neural networks, part 2: Convolution copies the kernel
1D convolution for neural networks, part 2: Convolution copies the kernel
Brandon Rohrer
49 1D convolution for neural networks, part 3: Sliding dot product equations longhand
1D convolution for neural networks, part 3: Sliding dot product equations longhand
Brandon Rohrer
50 1D convolution for neural networks, part 4: Convolution equation
1D convolution for neural networks, part 4: Convolution equation
Brandon Rohrer
51 1D convolution for neural networks, part 5: Backpropagation
1D convolution for neural networks, part 5: Backpropagation
Brandon Rohrer
52 1D convolution for neural networks, part 6: Input gradient
1D convolution for neural networks, part 6: Input gradient
Brandon Rohrer
53 1D convolution for neural networks, part 7: Weight gradient
1D convolution for neural networks, part 7: Weight gradient
Brandon Rohrer
54 1D convolution for neural networks, part 8: Padding
1D convolution for neural networks, part 8: Padding
Brandon Rohrer
1D convolution for neural networks, part 9: Stride
1D convolution for neural networks, part 9: Stride
Brandon Rohrer
56 The Four Grand Challenges of Robots in the Home
The Four Grand Challenges of Robots in the Home
Brandon Rohrer
57 How Convolution Works
How Convolution Works
Brandon Rohrer
58 The Softmax neural network layer
The Softmax neural network layer
Brandon Rohrer
59 Batch normalization
Batch normalization
Brandon Rohrer
60 Getting ready to learn Python, Mac edition #1: Files and directories
Getting ready to learn Python, Mac edition #1: Files and directories
Brandon Rohrer

This video teaches how to use stride in 1D convolution for neural networks to reduce output size and speed up computations. The speaker discusses the trade-offs between stride, output size, and computation speed, and how to apply these concepts in convolutional neural networks.

Key Takeaways
  1. Understand the concept of stride in 1D convolution
  2. Determine the appropriate stride for your signal processing task
  3. Apply stride to reduce output size and speed up computations
  4. Consider the trade-offs between stride, output size, and computation speed
  5. Use stride in convolutional neural networks to reduce resolution and speed up computations
💡 Using stride in 1D convolution can reduce output size and speed up computations, but may also reduce the accuracy of the model.

Related Reads

📰
Making fundamentals and advanced concepts very clear
Improve your fundamentals and advanced concepts in OOPS, DBMS, OS, and CN with recommended sources for interview preparation
Reddit r/learnprogramming
📰
The N+1 Query Problem in Java: Why Loading One Record Triggers 100 Queries
Learn to solve the N+1 query problem in Java using Spring Data JPA and Hibernate to improve performance
Medium · Programming
📰
Never Regress: Putting a Model in Your Query Optimizer Without Letting It Wreck the Plan
Learn how to integrate a model into your query optimizer without compromising the plan, using a Rust SDK that corrects row-count estimates
Dev.to · AI Explore
📰
The PRNG draw-tape: eager versus lazy
Learn about the PRNG draw-tape and the difference between eager and lazy approaches in generating random numbers for reproducibility
Dev.to · Ernesto Herrera Salinas
Up next
Arrays vs Lists: What AI Actually Prefers | Common Tech Interview Questions
SCALER
Watch →