# Convolution input and output channels

**URL:** <https://discuss.pytorch.org/t/convolution-input-and-output-channels/10205>\
**Category:** Uncategorized\
**Created:** [November 21, 2017, 7:48am UTC](https://discuss.pytorch.org/t/convolution-input-and-output-channels/10205 "2017-11-21T07:48:11Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![ptrblck](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/ptrblck/32/1823_2.png) [@ptrblck](https://discuss.pytorch.org/u/ptrblck)\
**Post date:** [November 21, 2017, 9:30am UTC](https://discuss.pytorch.org/t/convolution-input-and-output-channels/10205/2 "2017-11-21T09:30:18Z")

</div>

In the vanilla convolution each kernel convolves over the whole input volume.  
Example: Your input volume has 3 channels (RGB image).  
Now you would like to create a ConvLayer for this image. Each kernel in your ConvLayer will use all input channels of the input volume. Let’s assume you would like to use a 3 by 3 kernel. This kernel will have 27 weights and 1 bias, since (W \* H \* input\_Channels = 3 \* 3 \* 3 = 27 weights).  
The number of output channels is the number of different kernels used in your ConvLayer. If you would like to output 64 channels, your layer will have 64 different 3x3 kernels, each with 27 weights and 1 bias.

I hope this makes it a bit clearer.  
Have a look at [Stanford’s CS231n](http://cs231n.github.io/convolutional-networks/) if your would like to dig a bit deeper.

---

_[View the full topic](https://discuss.pytorch.org/t/convolution-input-and-output-channels/10205)._
