utils/layers.py
def conv2d_fixed_padding(inputs, filters, kernel_size, strides, use_bias,
                         data_format):
  """Strided 2-D convolution with explicit padding."""
  # The padding is consistent and is based only on `kernel_size`, not on the
  # dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone).
  if strides > 1:
    inputs = fixed_padding(inputs, kernel_size, data_format)

  return tf.layers.conv2d(
      inputs=inputs,
      filters=filters,
      kernel_size=kernel_size,
      strides=strides,
      padding=('SAME' if strides == 1 else 'VALID'),
      use_bias=use_bias,
    kernel_initializer=init_ops.variance_scaling_initializer(),
      data_format=data_format)
Strided 2-D convolution with explicit padding.
Strided 2-D convolution with explicit padding.
Strided 2 - D convolution with explicit padding .
def conv2d_fixed_padding(inputs, filters, kernel_size, strides, use_bias,
                         data_format):
  if strides > 1:
    inputs = fixed_padding(inputs, kernel_size, data_format)
  return tf.layers.conv2d(
      inputs=inputs,
      filters=filters,
      kernel_size=kernel_size,
      strides=strides,
      padding=('SAME' if strides == 1 else 'VALID'),
      use_bias=use_bias,
    kernel_initializer=init_ops.variance_scaling_initializer(),
      data_format=data_format)
def conv2d_fixed_padding ( inputs , filters , kernel_size , strides , use_bias , data_format ) : if strides > 1 : inputs = fixed_padding ( inputs , kernel_size , data_format ) return tf . layers . conv2d ( inputs = inputs , filters = filters , kernel_size = kernel_size , strides = strides , padding = ( 'SAME' if strides == 1 else 'VALID' ) , use_bias = use_bias , kernel_initializer = init_ops . variance_scaling_initializer ( ) , data_format = data_format )
Strided 2-D convolution with explicit padding.
Strided 2 - D convolution with explicit padding .
"""Strided 2-D convolution with explicit padding.""" # The padding is consistent and is based only on `kernel_size`, not on the # dimensions of `inputs` (as opposed to using `tf.layers.conv2d` alone).
inputs
filters
kernel_size
strides
use_bias
data_format