tf.contrib.layers.separable_conv2d(*args, **kwargs)
tf.contrib.layers.separable_convolution2d(*args, **kwargs)
See the guide: Layers (contrib) > Higher level ops for building neural network layers
Adds a depth-separable 2D convolution with optional batch_norm layer.
This op first performs a depthwise convolution that acts separately on channels, creating a variable called depthwise_weights
. If num_outputs
is not None, it adds a pointwise convolution that mixes channels, creating a variable called pointwise_weights
. Then, if batch_norm_params
is None, it adds bias to the result, creating a variable called 'biases', otherwise it adds a batch normalization layer. It finally applies an activation function to produce the end result.
inputs
: a tensor of size [batch_size, height, width, channels].num_outputs
: the number of pointwise convolution output filters. If is None, then we skip the pointwise convolution stage.kernel_size
: a list of length 2: [kernel_height, kernel_width] of of the filters. Can be an int if both values are the same.depth_multiplier
: the number of depthwise convolution output channels for each input channel. The total number of depthwise convolution output channels will be equal to num_filters_in * depth_multiplier
.stride
: a list of length 2: [stride_height, stride_width], specifying the depthwise convolution stride. Can be an int if both strides are the same.padding
: one of 'VALID' or 'SAME'.rate
: a list of length 2: [rate_height, rate_width], specifying the dilation rates for a'trous convolution. Can be an int if both rates are the same. If any value is larger than one, then both stride values need to be one.activation_fn
: activation function, set to None to skip it and maintain a linear activation.normalizer_fn
: normalization function to use instead of biases
. If normalizer_fn
is provided then biases_initializer
and biases_regularizer
are ignored and biases
are not created nor added. default set to None for no normalizer functionnormalizer_params
: normalization function parameters.weights_initializer
: An initializer for the weights.weights_regularizer
: Optional regularizer for the weights.biases_initializer
: An initializer for the biases. If None skip biases.biases_regularizer
: Optional regularizer for the biases.reuse
: whether or not the layer and its variables should be reused. To be able to reuse the layer scope must be given.variables_collections
: optional list of collections for all the variables or a dictionay containing a different list of collection per variable.outputs_collections
: collection to add the outputs.trainable
: whether or not the variables should be trainable or not.scope
: Optional scope for variable_scope.A Tensor
representing the output of the operation.
Defined in tensorflow/contrib/framework/python/ops/arg_scope.py
.
© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/layers/separable_conv2d