resnet_deconv2d_block¶
-
tfsnippet.layers.
resnet_deconv2d_block
(*args, **kwargs)¶ 2D deconvolutional ResNet block.
Parameters: - input (Tensor) – The input tensor.
- out_channels (int) – The channel numbers of the output.
- kernel_size (int or tuple[int]) – Kernel size over spatial dimensions, for “conv_0” and “conv_1” convolutional layers.
- conv_fn – The deconvolution function for “conv_0” and “conv_1”
deconvolutional layers. See
resnet_general_block()
. - strides (int or tuple[int]) – Strides over spatial dimensions, for “conv_0”, “conv_1” and “shortcut” deconvolutional layers.
- output_shape –
If specified, use this as the shape of the deconvolution output; otherwise compute the size of each dimension by:
output_size = input_size * strides if padding == 'valid': output_size += max(kernel_size - strides, 0)
- channels_last (bool) – Whether or not the channel axis is the last axis in input? (i.e., the data format is “NHWC”)
- use_shortcut_conv (True or None) – If
True
, force to apply a linear deconvolution transformation on the shortcut path. IfNone
(by default), only use shortcut if necessary. - shortcut_conv_fn – The deconvolution function for the “shortcut” deconvolutional layer. If not specified, use conv_fn.
- shortcut_kernel_size (int or tuple[int]) – Kernel size over spatial dimensions, for the “shortcut” deconvolutional layer.
- resize_at_exit (bool) – If
True
, resize the spatial dimensions at the “conv_1” deconvolutional layer. IfFalse
, resize at the “conv_0” deconvolutional layer. (see above) - after_conv_0 – The function to apply on the output of “conv_0” layer.
- after_conv_1 – The function to apply on the output of “conv_1” layer.
- activation_fn – The activation function.
- normalizer_fn – The normalizer function.
- dropout_fn – The dropout function.
- gated (bool) – Whether or not to use gate on the output of “conv_1”? conv_1_output = activation_fn(conv_1_output) * sigmoid(gate).
- gate_sigmoid_bias (Tensor) – The bias added to gate before applying the sigmoid activation.
- use_bias (bool or None) – Whether or not to use bias in “conv_0” and
“conv_1”? If
True
, will always use bias. IfNone
, will use bias only if normalizer_fn is not given. IfFalse
, will never use bias. Default isNone
. - name (str) – Default name of the variable scope. Will be uniquified. If not specified, generate one according to the class name.
- scope (str) – The name of the variable scope.
- **kwargs – Other named arguments passed to “conv_0”, “conv_1” and “shortcut” deconvolutional layers.
Returns: The output tensor.
Return type: tf.Tensor
See also