在給定 4-D input 和 filter 張量的情況下計算 2-D 深度卷積。
用法
tf.raw_ops.DepthwiseConv2dNative(
input, filter, strides, padding, explicit_paddings=[],
data_format='NHWC', dilations=[1, 1, 1, 1], name=None
)參數
-
input一個Tensor。必須是以下類型之一:half,bfloat16,float32,float64。 -
filter一個Tensor。必須與input具有相同的類型。 -
stridesints的列表。長度為 4 的一維。input的每個維度的滑動窗口的步幅。 -
paddingstring來自:"SAME", "VALID", "EXPLICIT"。要使用的填充算法的類型。 -
explicit_paddingsints的可選列表。默認為[]。 -
data_format一個可選的string來自:"NHWC", "NCHW"。默認為"NHWC"。指定輸入和輸出數據的數據格式。使用默認格式"NHWC",數據存儲順序為:[batch, height, width, channels]。或者,格式可以是"NCHW",數據存儲順序為:[batch, channels, height, width]。 -
dilationsints的可選列表。默認為[1, 1, 1, 1]。長度為 4 的一維張量。input的每個維度的膨脹因子。如果設置為 k > 1,則在該維度上的每個過濾器元素之間將有 k-1 個跳過的單元格。維度順序由data_format的值決定,詳見上文。批量和深度維度中的膨脹必須為 1。 -
name操作的名稱(可選)。
返回
-
一個
Tensor。具有與input相同的類型。
給定一個形狀為 [batch, in_height, in_width, in_channels] 的輸入張量和一個形狀為 [filter_height, filter_width, in_channels, channel_multiplier] 的濾波器/內核張量,包含深度為 1 的 in_channels 卷積濾波器,depthwise_conv2d 對每個輸入通道應用不同的濾波器(從 1 個通道擴展到 channel_multiplier 個通道),然後將結果連接在一起。因此,輸出具有in_channels * channel_multiplier 通道。
for k in 0..in_channels-1
for q in 0..channel_multiplier-1
output[b, i, j, k * channel_multiplier + q] =
sum_{di, dj} input[b, strides[1] * i + di, strides[2] * j + dj, k] *
filter[di, dj, k, q]
必須有 strides[0] = strides[3] = 1 。對於相同水平和頂點步幅的最常見情況,strides = [1, stride, stride, 1]。
相關用法
- Python tf.raw_ops.DepthToSpace用法及代碼示例
- Python tf.raw_ops.DecodeGif用法及代碼示例
- Python tf.raw_ops.DeserializeManySparse用法及代碼示例
- Python tf.raw_ops.Dequantize用法及代碼示例
- Python tf.raw_ops.DeserializeSparse用法及代碼示例
- Python tf.raw_ops.DecodeProtoV2用法及代碼示例
- Python tf.raw_ops.Dilation2D用法及代碼示例
- Python tf.raw_ops.DynamicPartition用法及代碼示例
- Python tf.raw_ops.DataFormatVecPermute用法及代碼示例
- Python tf.raw_ops.DiagPart用法及代碼示例
- Python tf.raw_ops.Diag用法及代碼示例
- Python tf.raw_ops.DynamicStitch用法及代碼示例
- Python tf.raw_ops.TPUReplicatedInput用法及代碼示例
- Python tf.raw_ops.Bitcast用法及代碼示例
- Python tf.raw_ops.SelfAdjointEigV2用法及代碼示例
- Python tf.raw_ops.BatchMatMul用法及代碼示例
- Python tf.raw_ops.OneHot用法及代碼示例
- Python tf.raw_ops.ResourceScatterNdSub用法及代碼示例
- Python tf.raw_ops.ReadVariableXlaSplitND用法及代碼示例
- Python tf.raw_ops.GatherV2用法及代碼示例
注:本文由純淨天空篩選整理自tensorflow.org大神的英文原創作品 tf.raw_ops.DepthwiseConv2dNative。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
