TensorFlow函数教程:tf.nn.dilation2d
2019-01-31 13:46 更新
tf.nn.dilation2d函数
tf.nn.dilation2d(
input,
filter,
strides,
rates,
padding,
name=None
)定义在:tensorflow/python/ops/gen_nn_ops.py.
请参阅指南:神经网络>形态学滤波
计算4-Dinput和3-Dfilter张量的灰度扩张.
input张量具有shape[batch, in_height, in_width, depth],filter张量具有shape[filter_height, filter_width, depth],即,每个输入通道都独立于其他输入通道进行处理,具有自己的结构函数.该output张量具有shape[batch, out_height, out_width, depth].输出张量的空间维度取决于padding算法.我们目前只支持默认的“NHWC”data_format.
详细地说,灰度形态2-D扩张是最大和相关(为了与conv2d一致,我们使用未经过镜像的滤波器):
output[b, y, x, c] =
max_{dy, dx} input[b,
strides[1] * y + rates[1] * dy,
strides[2] * x + rates[2] * dx,
c] +
filter[dy, dx, c]
当过滤器的大小等于池内核大小并包含全零时,最大池是一种特殊情况.
二元性的注意事项:filter对input的扩张等于反射filter对-input侵蚀的否定.
参数:
input:一个4-DTensor,必须是下列类型之一:float32,float64,int32,uint8,int16,int8,int64,bfloat16,uint16,half,uint32,uint64,shape为[batch, in_height, in_width, depth].filter:一个3-DTensor,必须与input具有相同类型,shape为[filter_height, filter_width, depth].strides:ints列表,长度>= 4.输入张量的每个维度的滑动窗口的步幅.必须是:[1, stride_height, stride_width, 1].rates:ints列表,长度>= 4.输入大步进行剧烈的形态学扩张.必须是:[1, rate_height, rate_width, 1].padding:string,可以是:"SAME", "VALID".要使用的填充算法的类型.name:操作的名称(可选).
返回:
一个Tensor,与input有相同的类型.
以上内容是否对您有帮助:

免费 AI IDE


更多建议: