1D convolution for neural networks, part 8: Padding
Key Takeaways
This video teaches one-dimensional convolution for neural networks with a focus on padding
Full Transcript
so far we've been assuming that the number of outputs is the same as the number of inputs so that means that we take our kernel we flip it it's odd-numbered and we put that central value of the kernel line it up with the first value of our inputs and then do our sliding dot product across and stop do our last evaluation when the center value of the kernel lines up with the last element in our signal what that does then is it gives us an output a result that's exactly the same length as the input there's actually no reason why this has to be the case so we can do something called padding which is adding reasonable values to the end of our signal so that we can convey a love that kernel first touches the first non-zero value of the signal it can still give us an output result when we pad with zeros we can get a reasonable set of outputs to go along with that when we the process that we were talking about before is essentially padding with zeros assuming that everything that is outside of that is zero and treating it as such but there are other things that we can do there are lots of ways to pad we could actually pad with a constant value this then might be more representative of the data that we're using the goal of padding is to extend the data set in a neutral way so it doesn't introduce new information or new artifacts any more than necessary so it could be that for your particular data set let's say you're estimating temperatures and you'd like to pad that out a little bit an average temperature wouldn't be zero an average temperature on neutral temperature you know might be 50 degrees Fahrenheit 20 degrees Celsius and you can use that as a fairly neutral way to extend your data set notice though that it does give you a different result those padded values matter they get folded into the convolution result so you want to think about what you use there another thing you can do that might be more representative of your data is to do a mirror padding so if you want to pad would say five values you actually go and take the last five values of your data set flip them around and tack them on to the end similarly you can take the first five flip them around and tack them on to the beginning this mirror padding gets you a nice neutral extension of your data set for the most part but you have to be careful of weird cases for instance if you're tracking weekly phenomena and say your weekends are very different from your weekdays if you do this you might end up with ten weekdays in a row or four or weekend days in a row so it's not entirely neutral all the time you have to be aware of what your data means notice again when you look at the results the results are different depending on how you Pat it another thing that you can do that occasionally make sense is to do circular padding so now instead of taking the elements off the end and flipping it and tacking it on the end as we do and mirror padding we take our five elements off the end reach back around and tack them on to the beginning of the data set similarly we take our five elements or in this case our four elements off the beginning and reach around and tack them on to the end of the data set this can be particularly useful if you're working with data that you know to be cyclical you know to change on a regular basis and if you sampled it over a round number of those cycles it can be a nice neutral way to extend the data set again though notice that it gives you a very different answer depending on how you pad so the takeaway here is to pad mindfully because when you're padding you're actually adding data to your signal if you don't do it well you can end up corrupting your signal
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 · 54 of 60
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
▶
55
56
57
58
59
60
Robot Learning with a Biologically-Inspired Brain (BECCA)
Brandon Rohrer
BECCA talk at AGI 2011
Brandon Rohrer
Robot Learning with a Biologically-Inspired Brain (BECCA), The Sequel
Brandon Rohrer
BECCA listens to The Hobbit
Brandon Rohrer
Learning the building blocks of speech: BECCA extracts a hierarchy of audio features
Brandon Rohrer
BECCA listens for sound effects in The Hobbit
Brandon Rohrer
BECCA finds movie trailers while watching the Big Bang Theory
Brandon Rohrer
Listening for unexpected sounds: BECCA detects anomalies in audio data
Brandon Rohrer
Learning the building blocks of vision: BECCA extracts a spatio-temporal hierarchy of features
Brandon Rohrer
Watching for the unexpected: BECCA detects anomalies in video data
Brandon Rohrer
BECCA finds a stationary target
Brandon Rohrer
BECCA finds a stationary target at 3X speed
Brandon Rohrer
BECCA watches the X-men and Bruce Lee
Brandon Rohrer
BECCA plays Quidditch
Brandon Rohrer
BECCA chases a ball
Brandon Rohrer
BECCA chases a ball, part 2
Brandon Rohrer
Becca chases a ball, part 3
Brandon Rohrer
BECCA creates features from MNIST
Brandon Rohrer
How reinforcement learning works in Becca 7
Brandon Rohrer
Deep Learning Demystified
Brandon Rohrer
How Data Science Works
Brandon Rohrer
How Convolutional Neural Networks work
Brandon Rohrer
How Bayes Theorem works
Brandon Rohrer
How Deep Neural Networks Work
Brandon Rohrer
Recurrent Neural Networks (RNN) and Long Short-Term Memory (LSTM)
Brandon Rohrer
How Support Vector Machines work / How to open a black box
Brandon Rohrer
How autocorrelation works
Brandon Rohrer
Getting closer to human intelligence through robotics
Brandon Rohrer
A minimalist's guide to slicing and indexing pandas DataFrames
Brandon Rohrer
How decision trees work
Brandon Rohrer
Data scientist archetypes
Brandon Rohrer
How to use python's datetime package
Brandon Rohrer
How optimization for machine learning works, part 1
Brandon Rohrer
How optimization for machine learning works, part 2
Brandon Rohrer
How optimization for machine learning works, part 3
Brandon Rohrer
How optimization for machine learning works, part 4
Brandon Rohrer
How convolutional neural networks work, in depth
Brandon Rohrer
How to pick a machine learning model 4: Splitting the data
Brandon Rohrer
How to pick a machine learning model 3: Choosing a loss function
Brandon Rohrer
How to pick a machine learning model 2: Separating signal from noise
Brandon Rohrer
How to pick a machine learning model 1: Choosing between models
Brandon Rohrer
How to pick a machine learning model 5: Navigating assumptions
Brandon Rohrer
What do neural networks learn?
Brandon Rohrer
Interview with iRobot's Director of Data Science Angela Bassa
Brandon Rohrer
How Backpropagation Works
Brandon Rohrer
Evolutionary Powell's method: A discrete optimizer for hyperparameter optimization
Brandon Rohrer
1D convolution for neural networks, part 1: Sliding dot product
Brandon Rohrer
1D convolution for neural networks, part 2: Convolution copies the kernel
Brandon Rohrer
1D convolution for neural networks, part 3: Sliding dot product equations longhand
Brandon Rohrer
1D convolution for neural networks, part 4: Convolution equation
Brandon Rohrer
1D convolution for neural networks, part 5: Backpropagation
Brandon Rohrer
1D convolution for neural networks, part 6: Input gradient
Brandon Rohrer
1D convolution for neural networks, part 7: Weight gradient
Brandon Rohrer
1D convolution for neural networks, part 8: Padding
Brandon Rohrer
1D convolution for neural networks, part 9: Stride
Brandon Rohrer
The Four Grand Challenges of Robots in the Home
Brandon Rohrer
How Convolution Works
Brandon Rohrer
The Softmax neural network layer
Brandon Rohrer
Batch normalization
Brandon Rohrer
Getting ready to learn Python, Mac edition #1: Files and directories
Brandon Rohrer
More on: Neural Network Basics
View skill →
🎓
Tutor Explanation
DeepCamp AI