vdumoulin / conv_arithmetic Goto Github PK
View Code? Open in Web Editor NEWA technical report on convolution arithmetic in the context of deep learning
License: MIT License
A technical report on convolution arithmetic in the context of deep learning
License: MIT License
Can anybody reveal the filtering process of deconvnet in the paper:
Visualizing and Understanding Convolutional Networks, arXiv:1311.2901v3
When I read the paper, I was confused by the filtering process of the deconvnet. They use the transpose of the same filter to convolute on the unpoolinged feature map.
It seems that the deconvolution process described in the paper is different from the process illustrated in this project.
Can anybody give a illustration on that or provide some addition material?
With thanks and regards!
It'd be great if there's also a gif of Partial Convolutions in the near future.
Thanks!
Test 102 details
Hi, Dumoulin,
Thanks for your beautiful work first.
Seems I found a small typo inside the tex file.
In 543 line at the .tex file, inside the bracket, that's the original content:
To factor in zero padding (i.e., only restricting to
$s = 0$ ),
I think the idea you want to show should be s = 1, either consider about the practical moving or the relationship below:
For any
$i$ ,$k$ and$p$ , and for$s = 1$ ,
Wish it is correct.
i' with a tilde is described but then i' is used in relationship 13.
I believe from the pdf that the cyan should be the input in the transposed convolution gifs, and the blue should be the output.
It should read:
N.B.: Blue maps are outputs, and cyan maps are inputs.
Please let me know if I'm interpreting the diagram wrong.
Hi! Great report :)
There is something confusing in gifs.
I can't distinguish (and probably nobody can) https://github.com/vdumoulin/conv_arithmetic/blob/master/gif/full_padding_no_strides_transposed.gif and https://github.com/vdumoulin/conv_arithmetic/blob/master/gif/no_padding_no_strides.gif (I'm not talking about width and height of feature map). You can't a priori tell what is up/down, input/output, before operation/after operation. I would suggest changing colors or (better) putting "input"/"output" labels.
@vdumoulin Thanks for your great job.Could I use a figure of deconvolution in your guide directly in my paper with a citation?
Part of the figure 4.6 caption states:
It is equivalent to convolving a 3 × 3 kernel over a 2 × 2 input
I think that should be:
It is equivalent to convolving a 3 × 3 kernel over a 3 × 3 input"
Edit: figure 4.7 may also have he same typo
I feel like the input and output could be mislabeled in transposed convolutional animation section.
what about make a Deformable Convolutional's gif image,thanks!
In the second last sentence of section 2.2 we have:
In practice, two specific instances of zero padding are used quite extensively because of their respective properties.
I suspect it should be:
"In practice, two specific instances of zero padding are used quite extensively because of their respective properties."
Edit:
The fist section of chapter 3 states:
Since pooling does not involve zero padding, the relationship describing the general case is as follows:
I think this should also be:
"Since pooling does not involve zero padding, the relationship describing the general case is as follows:"
or maybe "non-zero" padding?
or maybe:
"Since pooling only involves zero padding, the relationship describing the general case is as follows:"
I am attaching the two figures taken from the arXiV. In convolution:
it says the padding is 2x2
and in transposed, it also says the padding is 2x2. Shouldn't it be 1x1?
when i try to do "make all_animations" from the repository's root directory,
there is an error
(env_shan) Arithmetic@qingjiaowosuanshujiadeMacBook-Pro conv_arithmetic-master % make all_animations
convert -density 600 pdf/numerical_no_padding_no_strides_00.pdf -flatten -resize 25% png/numerical_no_padding_no_strides_00.png
make: convert: No such file or directory
make: *** [png/numerical_no_padding_no_strides_00.png] Error 1
the readme can't help me ,is there any one can fix it or give me some advice?
thx
Helllo, I'm a windows user. I want to know how to run the program. Please give a detailed introduce. Thank you!
I hit the following make error after downloading and doing ./bin/generate_makefile
jeremy@jeremy-TECRA-Z40-C:~conv_arithmetic$ make all_animations
./bin/produce_figure arithmetic no_padding_no_strides 0 --input-size=4 --output-size=2 --padding=0 --kernel-size=3 --stride=1
Traceback (most recent call last):
File "./bin/produce_figure", line 272, in <module>
compile_figure(which_, name, step, **args_dict)
File "./bin/produce_figure", line 223, in compile_figure
if '! LaTeX Error' in stdoutdata or '! Emergency stop' in stdoutdata:
TypeError: a bytes-like object is required, not 'str'
Makefile:98: recipe for target 'pdf/no_padding_no_strides_00.pdf' failed
make: *** [pdf/no_padding_no_strides_00.pdf] Error 1
makefile looks like
conv_arithmetic.pdf : export BSTINPUTS=$BSTINPUTS:./natbib
conv_arithmetic.pdf : conv_arithmetic.tex
pdflatex conv_arithmetic
pdflatex conv_arithmetic
bibtex conv_arithmetic
pdflatex conv_arithmetic
pdflatex conv_arithmetic
.PHONY : clean
clean :
rm -f conv_arithmetic.{aux,bbl,blg,log}
.PHONY : all_animations
all_animations : gif/no_padding_no_strides.gif gif/no_padding_no_strides_transposed.gif gif/arbitrary_padding_no_strides.gif gif/arbitrary_padding_no_strides_transposed.gif
gif/same_padding_no_strides.gif gif/same_padding_no_strides_transposed.gif gif/full_padding_no_strides.gif gif/full_padding_no_strides_transposed.gif gif/no_padding_stride
s.gif gif/no_padding_strides_transposed.gif gif/padding_strides.gif gif/padding_strides_transposed.gif gif/padding_strides_odd.gif gif/padding_strides_odd_transposed.gif gi
f/dilation.gif gif/numerical_no_padding_no_strides.gif gif/numerical_padding_strides.gif gif/numerical_average_pooling.gif gif/numerical_max_pooling.gif
.SECONDARY :
gif/no_padding_no_strides.gif : png/no_padding_no_strides_00.png png/no_padding_no_strides_01.png png/no_padding_no_strides_02.png png/no_padding_no_strides_03.png
convert -delay 100 -loop 0 -layers Optimize +map -dispose previous $^ $@
gifsicle --batch -O3 $@
gif/no_padding_no_strides_transposed.gif : png/no_padding_no_strides_transposed_00.png png/no_padding_no_strides_transposed_01.png png/no_padding_no_strides_transposed_02.p
ng png/no_padding_no_strides_transposed_03.png png/no_padding_no_strides_transposed_04.png png/no_padding_no_strides_transposed_05.png png/no_padding_no_strides_transposed_
06.png png/no_padding_no_strides_transposed_07.png png/no_padding_no_strides_transposed_08.png png/no_padding_no_strides_transposed_09.png png/no_padding_no_strides_transpo
sed_10.png png/no_padding_no_strides_transposed_11.png png/no_padding_no_strides_transposed_12.png png/no_padding_no_strides_transposed_13.png png/no_padding_no_strides_tra
nsposed_14.png png/no_padding_no_strides_transposed_15.png
convert -delay 100 -loop 0 -layers Optimize +map -dispose previous $^ $@
gifsicle --batch -O3 $@
gif/arbitrary_padding_no_strides.gif : png/arbitrary_padding_no_strides_00.png png/arbitrary_padding_no_strides_01.png png/arbitrary_padding_no_strides_02.png png/arbitrary
_padding_no_strides_03.png png/arbitrary_padding_no_strides_04.png png/arbitrary_padding_no_strides_05.png png/arbitrary_padding_no_strides_06.png png/arbitrary_padding_no_
strides_07.png png/arbitrary_padding_no_strides_08.png png/arbitrary_padding_no_strides_09.png png/arbitrary_padding_no_strides_10.png png/arbitrary_padding_no_strides_11.p
ng png/arbitrary_padding_no_strides_12.png png/arbitrary_padding_no_strides_13.png png/arbitrary_padding_no_strides_14.png png/arbitrary_padding_no_strides_15.png png/arbit
rary_padding_no_strides_16.png png/arbitrary_padding_no_strides_17.png png/arbitrary_padding_no_strides_18.png png/arbitrary_padding_no_strides_19.png png/arbitrary_padding
_no_strides_20.png png/arbitrary_padding_no_strides_21.png png/arbitrary_padding_no_strides_22.png png/arbitrary_padding_no_strides_23.png png/arbitrary_padding_no_strides_
24.png png/arbitrary_padding_no_strides_25.png png/arbitrary_padding_no_strides_26.png png/arbitrary_padding_no_strides_27.png png/arbitrary_padding_no_strides_28.png png/a
rbitrary_padding_no_strides_29.png png/arbitrary_padding_no_strides_30.png png/arbitrary_padding_no_strides_31.png png/arbitrary_padding_no_strides_32.png png/arbitrary_pad
....etc
I understand your algorithm and implementation for 2d convolution using shift register based concept. Do you think this concept can be applied for 3d convolution ?
Thanks for the great tutorial. The paper is informative and the animation is intuitive.
I would like to point out the kernel used in the deconvolution is not the same as the one used in the corresponding convolution, the former is a double-flipped version of the latter. For example, if the kernel used in the convolution is a 2x3 matrix [1,2,3; 4,5,6], i.e. first row is [1,2,3], and second row is [4,5,6], then the kernel used in the deconvolution is a double-flipped 2x3 matrix, (first flip along row-axis, then flip along column-axis). This results in [6,5,4;3,2,1], i.e. first row is [6,5,4], second row is [3,2,1].
If you agree with this, it would be nice to state it in the paper so that readers won't be confused.
Again, this is a great tutorial and I really appreciate it.
How did you draw such a beautiful gif?
Which soft-ware did you use?
make all_animations fails on Ubuntu Linux 14.04 as follows:
./bin/produce_figure arithmetic no_padding_no_strides 0 --input-size=4 --output-size=2 --padding=0 --kernel-size=3 --stride=1
Traceback (most recent call last):
File "./bin/produce_figure", line 272, in <module>
compile_figure(which_, name, step, **args_dict)
File "./bin/produce_figure", line 223, in compile_figure
if '! LaTeX Error' in stdoutdata or '! Emergency stop' in stdoutdata:
TypeError: a bytes-like object is required, not 'str'
make: *** [pdf/no_padding_no_strides_00.pdf] Error 1
The line, "The code and/or the images of this tutorial are free to use for non-commercial purposes with proper attribution:" in the README suggests that the same is not true for commercial purposes, but the MIT license permits commercial use.
Aren't there mistakes in the images 1 to 8 for numerical_padding_strides-*.pdf ? For instance shouldn't the second element of the first row be 5 ?
Here is what is computed:
0 0 0 0 0 0 0 1 6 5
0 2 2 3 3 3 0 Original result: 7 10 9
2 0 1 0 0 1 3 0 3 0 7 10 8
1 0 0 * 0 2 3 0 1 3 0 ---->
0 1 1 0 3 3 2 1 2 0 1 5 6
0 3 3 0 2 3 0 My result: 7 8 3
0 0 0 0 0 0 0 3 10 4
If I am correct then the mistakes are also on this website: http://deeplearning.net/software/theano/tutorial/conv_arithmetic.html
PS: Sorry for the chaotic display, can't figure it out.
The text says the feature maps are cyan and blue but the images show feature maps that are green and blue.
Thanks for the beautiful work first!
It seems to me that there a mistake on the animation of "Padding, strides, transposed (odd)" but I might be wrong. Looks it should have two lines of padding at the bottom right and one line of padding at the upper left, not the vice verse?
Thanks guys for this amazing report, it helped me a lot in understanding convolutional arithmetic.
I think I found a slight error in the description of the figure 4.7 description on page 27 (line 3). Straight from the report:
The transpose of convolving a
Shouldn't this be 3 \times 3 ? The visual is probably correct, this feels erroneous, and can be seen by calculating directly from the formula of the direct convolution.
Thanks for making this great guide! Its very useful and well written.
I am not sure if this is an error in the guide or a misunderstanding on my part.
Figures 2.1 through 2.4 are described as having "no stride" but then in the same sentence are described as having "unit strides" . It seems to me that "no stride" is not equivalent to "unit stride". IE: "no stride" should mean s=0
rather than s=1
.
See image below.
How can I customize a conv2d backward function,I just find a conv2d forward function
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.