MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / atrous_conv2d_transpose

Function atrous_conv2d_transpose

tensorflow/python/ops/nn_ops.py:2321–2469  ·  view source on GitHub ↗

The transpose of `atrous_conv2d`. This operation is sometimes called "deconvolution" after [Deconvolutional Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf), but is really the transpose (gradient) of `atrous_conv2d` rather than an actual deconvolution. Args

(value,
                            filters,
                            output_shape,
                            rate,
                            padding,
                            name=None)

Source from the content-addressed store, hash-verified

2319
2320@tf_export("nn.atrous_conv2d_transpose")
2321def atrous_conv2d_transpose(value,
2322 filters,
2323 output_shape,
2324 rate,
2325 padding,
2326 name=None):
2327 """The transpose of `atrous_conv2d`.
2328
2329 This operation is sometimes called "deconvolution" after [Deconvolutional
2330 Networks](https://www.matthewzeiler.com/mattzeiler/deconvolutionalnetworks.pdf),
2331 but is really the transpose (gradient) of `atrous_conv2d` rather than an
2332 actual deconvolution.
2333
2334 Args:
2335 value: A 4-D `Tensor` of type `float`. It needs to be in the default `NHWC`
2336 format. Its shape is `[batch, in_height, in_width, in_channels]`.
2337 filters: A 4-D `Tensor` with the same type as `value` and shape
2338 `[filter_height, filter_width, out_channels, in_channels]`. `filters`'
2339 `in_channels` dimension must match that of `value`. Atrous convolution is
2340 equivalent to standard convolution with upsampled filters with effective
2341 height `filter_height + (filter_height - 1) * (rate - 1)` and effective
2342 width `filter_width + (filter_width - 1) * (rate - 1)`, produced by
2343 inserting `rate - 1` zeros along consecutive elements across the
2344 `filters`' spatial dimensions.
2345 output_shape: A 1-D `Tensor` of shape representing the output shape of the
2346 deconvolution op.
2347 rate: A positive int32. The stride with which we sample input values across
2348 the `height` and `width` dimensions. Equivalently, the rate by which we
2349 upsample the filter values by inserting zeros across the `height` and
2350 `width` dimensions. In the literature, the same parameter is sometimes
2351 called `input stride` or `dilation`.
2352 padding: A string, either `'VALID'` or `'SAME'`. The padding algorithm.
2353 name: Optional name for the returned tensor.
2354
2355 Returns:
2356 A `Tensor` with the same type as `value`.
2357
2358 Raises:
2359 ValueError: If input/output depth does not match `filters`' shape, or if
2360 padding is other than `'VALID'` or `'SAME'`, or if the `rate` is less
2361 than one, or if the output_shape is not a tensor with 4 elements.
2362 """
2363 with ops.name_scope(name, "atrous_conv2d_transpose",
2364 [value, filters, output_shape]) as name:
2365 value = ops.convert_to_tensor(value, name="value")
2366 filters = ops.convert_to_tensor(filters, name="filters")
2367 if not value.get_shape().dims[3].is_compatible_with(filters.get_shape()[3]):
2368 raise ValueError(
2369 "value's input channels does not match filters' input channels, "
2370 "{} != {}".format(value.get_shape()[3],
2371 filters.get_shape()[3]))
2372 if rate < 1:
2373 raise ValueError("rate {} cannot be less than one".format(rate))
2374
2375 if rate == 1:
2376 return conv2d_transpose(
2377 value,
2378 filters,

Callers

nothing calls this directly

Calls 10

is_fully_definedMethod · 0.80
conv2d_transposeFunction · 0.70
name_scopeMethod · 0.45
is_compatible_withMethod · 0.45
get_shapeMethod · 0.45
formatMethod · 0.45
as_listMethod · 0.45
shapeMethod · 0.45
space_to_batchMethod · 0.45
batch_to_spaceMethod · 0.45

Tested by

no test coverage detected