Skip to content

Commit

Permalink
Add output shape equation to docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtvs committed Jun 19, 2018
1 parent 5f06a78 commit d714193
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions keras/layers/convolutional.py
Expand Up @@ -711,6 +711,9 @@ class Conv2DTranspose(Conv2D):
`(batch, new_rows, new_cols, filters)`
if `data_format` is `"channels_last"`.
`rows` and `cols` values might have changed due to padding.
If `output_padding` is specified:
`new_rows = (rows - 1) * strides[0] + kernel_size[0] - 2 * padding[0] + output_padding[0]`
`new_cols = (cols - 1) * strides[1] + kernel_size[1] - 2 * padding[1] + output_padding[1]`
# References
- [A guide to convolution arithmetic for deep learning](https://arxiv.org/abs/1603.07285v1)
Expand Down Expand Up @@ -969,6 +972,10 @@ class Conv3DTranspose(Conv3D):
`(batch, new_depth, new_rows, new_cols, filters)`
if `data_format` is `"channels_last"`.
`depth` and `rows` and `cols` values might have changed due to padding.
If `output_padding` is specified:
`new_depth = (depth - 1) * strides[0] + kernel_size[0] - 2 * padding[0] + output_padding[0]`
`new_rows = (rows - 1) * strides[1] + kernel_size[1] - 2 * padding[1] + output_padding[1]`
`new_cols = (cols - 1) * strides[2] + kernel_size[2] - 2 * padding[2] + output_padding[2]`
# References
- [A guide to convolution arithmetic for deep learning](https://arxiv.org/abs/1603.07285v1)
Expand Down

0 comments on commit d714193

Please sign in to comment.