计算 4-D input 和 3-D filters 张量的灰度膨胀。
用法
tf.nn.dilation2d(
input, filters, strides, padding, data_format, dilations, name=None
)参数
-
input一个Tensor。必须是以下类型之一:float32,float64,int32,uint8,int16,int8,int64,bfloat16,uint16,half,uint32,uint64。 4-D 形状[batch, in_height, in_width, depth]。 -
filters一个Tensor。必须与input具有相同的类型。 3-D 形状[filter_height, filter_width, depth]。 -
strides长度为>= 4的ints列表。输入张量的每个维度的滑动窗口的步幅。必须是:[1, stride_height, stride_width, 1]。 -
paddingAstring从:"SAME", "VALID".要使用的填充算法的类型。看这里了解更多信息。 -
data_formatAstring,目前仅支持"NHWC"。 -
dilations长度为>= 4的ints列表。 atrous 形态扩张的输入步幅。必须是:[1, rate_height, rate_width, 1]。 -
name操作的名称(可选)。
返回
-
一个
Tensor。具有与input相同的类型。
input 张量的形状为 [batch, in_height, in_width, depth] 而 filters 张量的形状为 [filter_height, filter_width, depth] ,即每个输入通道独立于其他输入通道进行处理,并具有自己的结构化函数。 output 张量的形状为 [batch, out_height, out_width, depth] 。输出张量的空间维度取决于padding 算法。我们目前只支持默认的 "NHWC" data_format 。
详细地说,灰度形态二维膨胀是 max-sum 相关性(为了与 conv2d 保持一致,我们使用非镜像过滤器):
output[b, y, x, c] =
max_{dy, dx} input[b,
strides[1] * y + rates[1] * dy,
strides[2] * x + rates[2] * dx,
c] +
filters[dy, dx, c]
Max-pooling 是过滤器的大小等于池化内核大小并且包含全零时的一种特殊情况。
关于对偶性的注意事项:filters 对input 的膨胀等于反射filters 对-input 的侵蚀的否定。
相关用法
- Python tf.nn.dropout用法及代码示例
- Python tf.nn.depth_to_space用法及代码示例
- Python tf.nn.depthwise_conv2d用法及代码示例
- Python tf.nn.embedding_lookup_sparse用法及代码示例
- Python tf.nn.RNNCellResidualWrapper.set_weights用法及代码示例
- Python tf.nn.gelu用法及代码示例
- Python tf.nn.RNNCellDeviceWrapper.set_weights用法及代码示例
- Python tf.nn.embedding_lookup用法及代码示例
- Python tf.nn.RNNCellDeviceWrapper.get_weights用法及代码示例
- Python tf.nn.local_response_normalization用法及代码示例
- Python tf.nn.scale_regularization_loss用法及代码示例
- Python tf.nn.RNNCellResidualWrapper.add_loss用法及代码示例
- Python tf.nn.max_pool用法及代码示例
- Python tf.nn.RNNCellDropoutWrapper.set_weights用法及代码示例
- Python tf.nn.l2_loss用法及代码示例
- Python tf.nn.log_softmax用法及代码示例
- Python tf.nn.weighted_cross_entropy_with_logits用法及代码示例
- Python tf.nn.ctc_greedy_decoder用法及代码示例
- Python tf.nn.RNNCellResidualWrapper.get_weights用法及代码示例
- Python tf.nn.compute_average_loss用法及代码示例
注:本文由纯净天空筛选整理自tensorflow.org大神的英文原创作品 tf.nn.dilation2d。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
