The transpose of `conv2d`. This operation is sometimes called "deconvolution" after [Deconvolutional Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf), but is really the transpose (gradient) of `conv2d` rather than an actual deconvolution. Args: value: A
(
value=None,
filter=None, # pylint: disable=redefined-builtin
output_shape=None,
strides=None,
padding="SAME",
data_format="NHWC",
name=None,
input=None, # pylint: disable=redefined-builtin
filters=None,
dilations=None)
| 2178 | |
| 2179 | @tf_export(v1=["nn.conv2d_transpose"]) |
| 2180 | def conv2d_transpose( |
| 2181 | value=None, |
| 2182 | filter=None, # pylint: disable=redefined-builtin |
| 2183 | output_shape=None, |
| 2184 | strides=None, |
| 2185 | padding="SAME", |
| 2186 | data_format="NHWC", |
| 2187 | name=None, |
| 2188 | input=None, # pylint: disable=redefined-builtin |
| 2189 | filters=None, |
| 2190 | dilations=None): |
| 2191 | """The transpose of `conv2d`. |
| 2192 | |
| 2193 | This operation is sometimes called "deconvolution" after [Deconvolutional |
| 2194 | Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf), |
| 2195 | but is really the transpose (gradient) of `conv2d` rather than an actual |
| 2196 | deconvolution. |
| 2197 | |
| 2198 | Args: |
| 2199 | value: A 4-D `Tensor` of type `float` and shape |
| 2200 | `[batch, height, width, in_channels]` for `NHWC` data format or |
| 2201 | `[batch, in_channels, height, width]` for `NCHW` data format. |
| 2202 | filter: A 4-D `Tensor` with the same type as `value` and shape |
| 2203 | `[height, width, output_channels, in_channels]`. `filter`'s |
| 2204 | `in_channels` dimension must match that of `value`. |
| 2205 | output_shape: A 1-D `Tensor` representing the output shape of the |
| 2206 | deconvolution op. |
| 2207 | strides: An int or list of `ints` that has length `1`, `2` or `4`. The |
| 2208 | stride of the sliding window for each dimension of `input`. If a single |
| 2209 | value is given it is replicated in the `H` and `W` dimension. By default |
| 2210 | the `N` and `C` dimensions are set to 0. The dimension order is determined |
| 2211 | by the value of `data_format`, see below for details. |
| 2212 | padding: A string, either `'VALID'` or `'SAME'`. The padding algorithm. |
| 2213 | See the "returns" section of `tf.nn.convolution` for details. |
| 2214 | data_format: A string. 'NHWC' and 'NCHW' are supported. |
| 2215 | name: Optional name for the returned tensor. |
| 2216 | input: Alias for value. |
| 2217 | filters: Alias for filter. |
| 2218 | dilations: An int or list of `ints` that has length `1`, `2` or `4`, |
| 2219 | defaults to 1. The dilation factor for each dimension of`input`. If a |
| 2220 | single value is given it is replicated in the `H` and `W` dimension. By |
| 2221 | default the `N` and `C` dimensions are set to 1. If set to k > 1, there |
| 2222 | will be k-1 skipped cells between each filter element on that dimension. |
| 2223 | The dimension order is determined by the value of `data_format`, see above |
| 2224 | for details. Dilations in the batch and depth dimensions if a 4-d tensor |
| 2225 | must be 1. |
| 2226 | |
| 2227 | Returns: |
| 2228 | A `Tensor` with the same type as `value`. |
| 2229 | |
| 2230 | Raises: |
| 2231 | ValueError: If input/output depth does not match `filter`'s shape, or if |
| 2232 | padding is other than `'VALID'` or `'SAME'`. |
| 2233 | """ |
| 2234 | value = deprecated_argument_lookup("input", input, "value", value) |
| 2235 | filter = deprecated_argument_lookup("filters", filters, "filter", filter) |
| 2236 | with ops.name_scope(name, "conv2d_transpose", |
| 2237 | [value, filter, output_shape]) as name: |
no test coverage detected