tf.keras.ops.conv_transpose
Stay organized with collections
Save and categorize content based on your preferences.
General N-D convolution transpose.
tf.keras.ops.conv_transpose(
inputs,
kernel,
strides,
padding='valid',
output_padding=None,
data_format=None,
dilation_rate=1
)
Also known as de-convolution. This ops supports 1D, 2D and 3D convolution.
Args |
inputs
|
Tensor of rank N+2. inputs has shape
(batch_size,) + inputs_spatial_shape + (num_channels,) if
data_format="channels_last" , or
(batch_size, num_channels) + inputs_spatial_shape if
data_format="channels_first" .
|
kernel
|
Tensor of rank N+2. kernel has shape
[kernel_spatial_shape, num_output_channels, num_input_channels],
num_input_channels should match the number of channels in
inputs .
|
strides
|
int or int tuple/list of len(inputs_spatial_shape) ,
specifying the strides of the convolution along each spatial
dimension. If strides is int, then every spatial dimension shares
the same strides .
|
padding
|
string, either "valid" or "same" . "valid" means no
padding is applied, and "same" results in padding evenly to the
left/right or up/down of the input such that output has the
same height/width dimension as the input when strides=1 .
|
output_padding
|
int or int tuple/list of len(inputs_spatial_shape) ,
specifying the amount of padding along the height and width of
the output tensor. Can be a single integer to specify the same
value for all spatial dimensions. The amount of output padding
along a given dimension must be lower than the stride along that
same dimension. If set to None (default), the output shape is
inferred.
|
data_format
|
A string, either "channels_last" or "channels_first" .
data_format determines the ordering of the dimensions in the
inputs. If data_format="channels_last" , inputs is of shape
(batch_size, ..., channels) while if
data_format="channels_first" , inputs is of shape
(batch_size, channels, ...) .
|
dilation_rate
|
int or int tuple/list of len(inputs_spatial_shape) ,
specifying the dilation rate to use for dilated convolution. If
dilation_rate is int, then every spatial dimension shares
the same dilation_rate .
|
Returns |
A tensor of rank N+2, the result of the conv operation.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2024-06-07 UTC.
[null,null,["Last updated 2024-06-07 UTC."],[],[],null,["# tf.keras.ops.conv_transpose\n\n\u003cbr /\u003e\n\n|----------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/keras-team/keras/tree/v3.3.3/keras/src/ops/nn.py#L1182-L1254) |\n\nGeneral N-D convolution transpose.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.keras.ops.nn.conv_transpose`](https://www.tensorflow.org/api_docs/python/tf/keras/ops/conv_transpose)\n\n\u003cbr /\u003e\n\n tf.keras.ops.conv_transpose(\n inputs,\n kernel,\n strides,\n padding='valid',\n output_padding=None,\n data_format=None,\n dilation_rate=1\n )\n\nAlso known as de-convolution. This ops supports 1D, 2D and 3D convolution.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `inputs` | Tensor of rank N+2. `inputs` has shape `(batch_size,) + inputs_spatial_shape + (num_channels,)` if `data_format=\"channels_last\"`, or `(batch_size, num_channels) + inputs_spatial_shape` if `data_format=\"channels_first\"`. |\n| `kernel` | Tensor of rank N+2. `kernel` has shape \\[kernel_spatial_shape, num_output_channels, num_input_channels\\], `num_input_channels` should match the number of channels in `inputs`. |\n| `strides` | int or int tuple/list of `len(inputs_spatial_shape)`, specifying the strides of the convolution along each spatial dimension. If `strides` is int, then every spatial dimension shares the same `strides`. |\n| `padding` | string, either `\"valid\"` or `\"same\"`. `\"valid\"` means no padding is applied, and `\"same\"` results in padding evenly to the left/right or up/down of the input such that output has the same height/width dimension as the input when `strides=1`. |\n| `output_padding` | int or int tuple/list of `len(inputs_spatial_shape)`, specifying the amount of padding along the height and width of the output tensor. Can be a single integer to specify the same value for all spatial dimensions. The amount of output padding along a given dimension must be lower than the stride along that same dimension. If set to `None` (default), the output shape is inferred. |\n| `data_format` | A string, either `\"channels_last\"` or `\"channels_first\"`. `data_format` determines the ordering of the dimensions in the inputs. If `data_format=\"channels_last\"`, `inputs` is of shape `(batch_size, ..., channels)` while if `data_format=\"channels_first\"`, `inputs` is of shape `(batch_size, channels, ...)`. |\n| `dilation_rate` | int or int tuple/list of `len(inputs_spatial_shape)`, specifying the dilation rate to use for dilated convolution. If `dilation_rate` is int, then every spatial dimension shares the same `dilation_rate`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|---|---|\n| A tensor of rank N+2, the result of the conv operation. ||\n\n\u003cbr /\u003e"]]