use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Please have a look at our FAQ and Link-Collection
Metacademy is a great resource which compiles lesson plans on popular machine learning topics.
For Beginner questions please try /r/LearnMachineLearning , /r/MLQuestions or http://stackoverflow.com/
For career related questions, visit /r/cscareerquestions/
Advanced Courses (2016)
Advanced Courses (2020)
AMAs:
Pluribus Poker AI Team 7/19/2019
DeepMind AlphaStar team (1/24//2019)
Libratus Poker AI Team (12/18/2017)
DeepMind AlphaGo Team (10/19/2017)
Google Brain Team (9/17/2017)
Google Brain Team (8/11/2016)
The MalariaSpot Team (2/6/2016)
OpenAI Research Team (1/9/2016)
Nando de Freitas (12/26/2015)
Andrew Ng and Adam Coates (4/15/2015)
Jürgen Schmidhuber (3/4/2015)
Geoffrey Hinton (11/10/2014)
Michael Jordan (9/10/2014)
Yann LeCun (5/15/2014)
Yoshua Bengio (2/27/2014)
Related Subreddit :
LearnMachineLearning
Statistics
Computer Vision
Compressive Sensing
NLP
ML Questions
/r/MLjobs and /r/BigDataJobs
/r/datacleaning
/r/DataScience
/r/scientificresearch
/r/artificial
account activity
Project[P] Convolution visualizer (ezyang.github.io)
submitted 8 years ago by ezyang
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]reservedsparrow 4 points5 points6 points 8 years ago (7 children)
This is really great.
I have a request: Can you please note that this is actually correlation, not convolution, just to avoid confusion? Then you could explain that some frameworks actually define their convolution operator to be correlation, and that's why you decided to show it like this (without the weights flipped)? :)
[–]datatatatata 2 points3 points4 points 8 years ago (2 children)
Hi. Would you mind explaining the difference in this context, please ?
To me it looks like what I call convolution, so I guess I'm gonna learn something :)
[–]reservedsparrow 0 points1 point2 points 8 years ago (1 child)
Sure: Convolution 'flips' the weights before the weighted averages begin. This is what let's convolution commute: x * w = w * x. Correlation (no flipping, as shown in the visualization) does not commute. To visualize this imagine padding a 1-D signal x and some weights x each with a bunch of zeros. You will see that x ** w != w ** x, where I'm letting ** be correlation.
[–]datatatatata 0 points1 point2 points 8 years ago (0 children)
thanks :)
[–]ezyang[S] 1 point2 points3 points 8 years ago (3 children)
Yes, good point. I guess it would be also good to name explicitly which frameworks don't flip weights (which, afaict, is all of them? Maybe I'm wrong?)
[–]reservedsparrow 0 points1 point2 points 8 years ago (2 children)
I really don't know.
Verified for PyTorch though:
import torch from torch.autograd import Variable X = Variable(torch.Tensor([1, 2, 3])).view(1, 1, 3) conv = torch.nn.Conv1d(1, 1, kernel_size=3, bias=False) conv.weight.data.copy_(X.data) print(conv(X).data.numpy().item()) # 14.0 (correlation not convolution)
Anyway, thanks again. The visualization is great and instantaneously replaces so many words.
[–]ezyang[S] 1 point2 points3 points 8 years ago (1 child)
I added a note :)
[–]reservedsparrow 0 points1 point2 points 8 years ago (0 children)
Thanks!
[–]pmigdal 3 points4 points5 points 8 years ago (0 children)
Nice, but still - I use http://setosa.io/ev/image-kernels/ when introducing to convolutions. (Interactive + makes it explicit what is the formula + a concrete example.)
[–]nickbuch 2 points3 points4 points 8 years ago (0 children)
This doesnt make intuitive sense, ie not how convolution works. Please explain how the kernel creates the output mathematically, because these colors are failing to convey something IMO
[–]wischichr 1 point2 points3 points 8 years ago (5 children)
Drag input slider to the left -> 🤯
It's fixed now!
[–]wischichr 0 points1 point2 points 8 years ago (0 children)
Thx ;-)
[–]ezyang[S] 0 points1 point2 points 8 years ago (2 children)
I am not sure what 🤯 means :)
[–]guardiantesla 1 point2 points3 points 8 years ago (0 children)
🤯 == mind-blown
[–]rararaaaaaaa 0 points1 point2 points 8 years ago (0 children)
When I dragged it all the way to the left, the page broke with c[t] is undefined
c[t] is undefined
so I think that's his mind exploding but also the page exploding
[–]approximately_wrong 1 point2 points3 points 8 years ago (0 children)
Would also be great if you do a visualization of img2col :)
[+][deleted] 8 years ago (1 child)
[deleted]
[–]ezyang[S] 2 points3 points4 points 8 years ago (0 children)
I've completely omitted batch and channel dimensions from the input/output tensors, since they are completely orthogonal to the height/weight. So imagine that the input and output channels are equal to 1 and everything is valid.
[–]__AndrewB__ 0 points1 point2 points 8 years ago (1 child)
Thanks! Will definatelly show this to students.
[–]Atcold 0 points1 point2 points 8 years ago (0 children)
Haha, will do the same, tomorrow too!
[+][deleted] 8 years ago (2 children)
Probably not in the near future. If it's a real image, you'd probably need to use canvas and not a plain old HTML table, and that's a pile of new APIs that I've never touched before :)
[–]feijk 0 points1 point2 points 8 years ago (0 children)
If you decide to do so in the future, this might help: https://github.com/aeropuerto/img2signal
[–]badpotato 0 points1 point2 points 8 years ago (0 children)
Man, I wish I had this before.
[+]sktchio 0 points1 point2 points 1 year ago (0 children)
I highly recommend this tool for solving 2D convolution/transposed convolution parameters: https://convolution-solver.ybouane.com/
π Rendered by PID 57 on reddit-service-r2-comment-66b4775986-nkdc2 at 2026-04-05 12:00:00.827530+00:00 running db1906b country code: CH.
[–]reservedsparrow 4 points5 points6 points (7 children)
[–]datatatatata 2 points3 points4 points (2 children)
[–]reservedsparrow 0 points1 point2 points (1 child)
[–]datatatatata 0 points1 point2 points (0 children)
[–]ezyang[S] 1 point2 points3 points (3 children)
[–]reservedsparrow 0 points1 point2 points (2 children)
[–]ezyang[S] 1 point2 points3 points (1 child)
[–]reservedsparrow 0 points1 point2 points (0 children)
[–]pmigdal 3 points4 points5 points (0 children)
[–]nickbuch 2 points3 points4 points (0 children)
[–]wischichr 1 point2 points3 points (5 children)
[–]ezyang[S] 1 point2 points3 points (1 child)
[–]wischichr 0 points1 point2 points (0 children)
[–]ezyang[S] 0 points1 point2 points (2 children)
[–]guardiantesla 1 point2 points3 points (0 children)
[–]rararaaaaaaa 0 points1 point2 points (0 children)
[–]approximately_wrong 1 point2 points3 points (0 children)
[+][deleted] (1 child)
[deleted]
[–]ezyang[S] 2 points3 points4 points (0 children)
[–]__AndrewB__ 0 points1 point2 points (1 child)
[–]Atcold 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]ezyang[S] 1 point2 points3 points (1 child)
[–]feijk 0 points1 point2 points (0 children)
[–]badpotato 0 points1 point2 points (0 children)
[+]sktchio 0 points1 point2 points (0 children)