Creates an Atrous Spatial Pyramid Pooling (ASPP) layer.
tfm.vision.decoders.ASPP(
level: int,
dilation_rates: List[int],
num_filters: int = 256,
pool_kernel_size: Optional[int] = None,
use_sync_bn: bool = False,
norm_momentum: float = 0.99,
norm_epsilon: float = 0.001,
activation: str = 'relu',
dropout_rate: float = 0.0,
kernel_initializer: str = 'VarianceScaling',
kernel_regularizer: Optional[tf.keras.regularizers.Regularizer] = None,
interpolation: str = 'bilinear',
use_depthwise_convolution: bool = False,
spp_layer_version: str = 'v1',
output_tensor: bool = False,
**kwargs
)
Args |
level: An int level to apply ASPP.
dilation_rates: A list of dilation rates.
num_filters: An int number of output filters in ASPP.
pool_kernel_size: A list of [height, width] of pooling kernel size or
None. Pooling size is with respect to original image size, it will be
scaled down by 2**level. If None, global average pooling is used.
use_sync_bn: A bool . If True, use synchronized batch normalization.
norm_momentum: A float of normalization momentum for the moving average.
norm_epsilon: A float added to variance to avoid dividing by zero.
activation: A str activation to be used in ASPP.
dropout_rate: A float rate for dropout regularization.
kernel_initializer: A str name of kernel_initializer for convolutional
layers.
kernel_regularizer: A tf.keras.regularizers.Regularizer object for
Conv2D. Default is None.
interpolation: A str of interpolation method. It should be one of
bilinear , nearest , bicubic , area , lanczos3 , lanczos5 ,
gaussian , or mitchellcubic .
use_depthwise_convolution: If True depthwise separable convolutions will
be added to the Atrous spatial pyramid pooling.
|
spp_layer_version
|
A str of spatial pyramid pooling layer version.
|
output_tensor
|
Whether to output a single tensor or a dictionary of tensor.
Default is false.
**kwargs: Additional keyword arguments to be passed.
|
Methods
call
View source
call(
inputs: TensorMapUnion
) -> TensorMapUnion
Calls the Atrous Spatial Pyramid Pooling (ASPP) layer on an input.
The output of ASPP will be a dict of {level
, tf.Tensor
} even if only one
level is present, if output_tensor is false. Hence, this will be compatible
with the rest of the segmentation model interfaces.
If output_tensor is true, a single tensot is output.
Args |
inputs
|
A tf.Tensor of shape [batch, height_l, width_l, filter_size] or
a dict of tf.Tensor where
- key: A
str of the level of the multilevel feature maps.
- values: A
tf.Tensor of shape [batch, height_l, width_l,
filter_size].
|
Returns |
A tf.Tensor of shape [batch, height_l, width_l, filter_size] or a dict
of tf.Tensor where
- key: A
str of the level of the multilevel feature maps.
- values: A
tf.Tensor of output of ASPP module.
|