resnet_conv2d_block

tfsnippet.layers.resnet_conv2d_block(*args, **kwargs)

2D convolutional 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 convolution function for “conv_0” and “conv_1” convolutional layers. See resnet_general_block().
  • strides (int or tuple[int]) – Strides over spatial dimensions, for “conv_0”, “conv_1” and “shortcut” convolutional layers.
  • 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 convolution transformation on the shortcut path. If None (by default), only use shortcut if necessary.
  • shortcut_conv_fn – The convolution function for the “shortcut” convolutional layer. If not specified, use conv_fn.
  • shortcut_kernel_size (int or tuple[int]) – Kernel size over spatial dimensions, for the “shortcut” convolutional layer.
  • resize_at_exit (bool) – If True, resize the spatial dimensions at the “conv_1” convolutional layer. If False, resize at the “conv_0” convolutional 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. If None, will use bias only if normalizer_fn is not given. If False, will never use bias. Default is None.
  • 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” convolutional layers.
Returns:

The output tensor.

Return type:

tf.Tensor