計算 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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
