計算 4-D value 和 3-D filters 張量的灰度侵蝕。
用法
tf.nn.erosion2d(
value, filters, strides, padding, data_format, dilations, name=None
)參數
-
value一個Tensor。 4-D 形狀[batch, in_height, in_width, depth]。 -
filters一個Tensor。必須與value具有相同的類型。 3-D 形狀[filters_height, filters_width, depth]。 -
strides長度為>= 4的ints列表。長度為 4 的一維。輸入張量的每個維度的滑動窗口的步幅。必須是:[1, stride_height, stride_width, 1]。 -
paddingAstring從:"SAME", "VALID".要使用的填充算法的類型。看這裏了解更多信息。 -
data_formatAstring,目前僅支持"NHWC"。 -
dilations長度為>= 4的ints列表。長度為 4 的 1-D。atrous 形態擴張的輸入步幅。必須是:[1, rate_height, rate_width, 1]。 -
name操作的名稱(可選)。如果未指定,則使用 "erosion2d"。
返回
-
一個
Tensor。具有與value相同的類型。 4-D 形狀[batch, out_height, out_width, depth]。
拋出
-
ValueError如果value深度與filters' 形狀不匹配,或者填充不是'VALID'或'SAME'。
value 張量的形狀為 [batch, in_height, in_width, depth] 而 filters 張量的形狀為 [filters_height, filters_width, depth] ,即每個輸入通道獨立於其他輸入通道進行處理,並具有自己的結構化函數。 output 張量的形狀為 [batch, out_height, out_width, depth] 。輸出張量的空間維度取決於padding 算法。我們目前隻支持默認的 "NHWC" data_format 。
詳細而言,灰度形態二維侵蝕由下式給出:
output[b, y, x, c] =
min_{dy, dx} value[b,
strides[1] * y - dilations[1] * dy,
strides[2] * x - dilations[2] * dx,
c] -
filters[dy, dx, c]
對偶性:filters對value的腐蝕等於-value被反射的filters對膨脹的否定。
相關用法
- Python tf.nn.embedding_lookup_sparse用法及代碼示例
- Python tf.nn.embedding_lookup用法及代碼示例
- Python tf.nn.experimental.stateless_dropout用法及代碼示例
- Python tf.nn.elu用法及代碼示例
- Python tf.nn.RNNCellResidualWrapper.set_weights用法及代碼示例
- Python tf.nn.dropout用法及代碼示例
- Python tf.nn.gelu用法及代碼示例
- Python tf.nn.RNNCellDeviceWrapper.set_weights用法及代碼示例
- 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.dilation2d用法及代碼示例
- Python tf.nn.RNNCellResidualWrapper.get_weights用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.nn.erosion2d。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
