explaingit

vdumoulin/conv_arithmetic

Analysis updated 2026-06-24

14,644TeXAudience · researcherComplexity · 2/5Setup · moderate

TLDR

Source for the Dumoulin and Visin paper on convolution arithmetic, plus animated GIFs that show how padding, stride, and dilation change CNN output sizes.

Mindmap

mindmap
  root((conv_arithmetic))
    Inputs
      LaTeX sources
      Filter and stride params
      Makefile config
    Outputs
      Animated GIFs
      PDF paper
      PNG and PDF frames
    Use Cases
      Teach CNN shape math
      Embed GIFs in slides
      Reproduce the paper
      Visualise transposed convs
    Tech Stack
      TeX
      LaTeX
      Make
      Python
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Use the GIFs in slides or blog posts to teach how convolution output size is computed

USE CASE 2

Regenerate the animations with custom filter sizes for your own paper figures

USE CASE 3

Compile the LaTeX paper locally and cite the resulting PDF in coursework

USE CASE 4

Reference the transposed and dilated convolution diagrams when debugging CNN architectures

What is it built with?

TeXLaTeXMakePython

How does it compare?

vdumoulin/conv_arithmetictuhdo/os01unicitynetwork/whitepaper
Stars14,64413,54313,178
LanguageTeXTeXTeX
Setup difficultymoderatehardeasy
Complexity2/55/51/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Rebuilding needs a full LaTeX toolchain plus Python animation deps, the README points to the arXiv paper for any actual explanation.

In plain English

This repository is the source for a short technical report and a set of accompanying animations about convolution arithmetic in deep learning. Convolution is a math operation used inside the type of neural networks that read images, and the arithmetic part is the small but fiddly rules about how the size of the output depends on the input size, the filter size, padding, and stride. The report itself is a paper by Vincent Dumoulin and Francesco Visin called A guide to convolution arithmetic for deep learning, available on arXiv at 1603.07285. The most visible part of the repository is its animated GIFs, which show small grids of blue input squares being scanned by a moving filter to produce a smaller cyan output. The README lays these out in three tables. The first table covers ordinary convolutions in seven variants: no padding with no strides, arbitrary padding with no strides, half padding, full padding, then the same three padding choices combined with strides, plus an odd stride case. The second table shows the same set of cases but for transposed convolutions, which are sometimes used to upsample or reverse a convolution. The third table shows a single dilated convolution animation, where the filter skips positions on the input. The rest of the README explains how to rebuild everything from source. There is a small shell script in bin/generate_makefile that creates the Makefile. Once that is in place, running make all_animations regenerates every GIF into the gif directory, with intermediate frames written as PDF and PNG into pdf and png directories. Running plain make compiles the LaTeX document into the final PDF. The README also reminds users that the code and images are free to use under the project's licence as long as the paper is properly cited. There is no other description of how the math works inside the README, for that, the reader is pointed to the arXiv paper.

Copy-paste prompts

Prompt 1
Modify the conv_arithmetic generator to produce a GIF for a 5x5 input with stride 2 and padding 1
Prompt 2
Explain using conv_arithmetic diagrams why a transposed convolution is not a true inverse of convolution
Prompt 3
Compile the LaTeX paper in conv_arithmetic on a fresh Ubuntu install and list the texlive packages needed
Prompt 4
Use the dilation animation logic to render a new GIF with dilation rate 3 for a 7x7 filter
Prompt 5
Help me embed selected conv_arithmetic GIFs into a Jupyter notebook explaining CNN shapes

Frequently asked questions

What is conv_arithmetic?

Source for the Dumoulin and Visin paper on convolution arithmetic, plus animated GIFs that show how padding, stride, and dilation change CNN output sizes.

What language is conv_arithmetic written in?

Mainly TeX. The stack also includes TeX, LaTeX, Make.

How hard is conv_arithmetic to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is conv_arithmetic for?

Mainly researcher.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.