tensorflow::ops::DepthwiseConv2dNative
#include <nn_ops.h> คำนวณการคอนโวลูชันเชิงลึกแบบ 2 มิติ โดยใช้ input และเทนเซอร์ filter แบบ 4 มิติ
สรุป
เมื่อกำหนดเทนเซอร์อินพุตที่มีรูปร่าง [batch, in_height, in_width, in_channels] และเทนเซอร์ฟิลเตอร์/เคอร์เนลที่มีรูปร่าง [filter_height, filter_width, in_channels, channel_multiplier] ซึ่งประกอบด้วยฟิลเตอร์คอนโวลูชันจำนวน in_channels ที่มีความลึก 1 ฟังก์ชัน 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 ในแนวนอนและจุดยอดเหมือนกัน strides = [1, stride, stride, 1]
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- ระยะก้าว: 1 มิติ ความยาว 4 ระยะก้าวของหน้าต่างเลื่อนสำหรับแต่ละมิติของ
input - การเติมช่องว่าง: ประเภทของอัลกอริทึมการเติมช่องว่างที่จะใช้
คุณลักษณะเสริม (ดูที่ Attrs ):
- data_format: ระบุรูปแบบข้อมูลของข้อมูลขาเข้าและขาออก โดยรูปแบบเริ่มต้นคือ "NHWC" ข้อมูลจะถูกจัดเก็บในลำดับ: [ชุดข้อมูล, ความสูง, ความกว้าง, ช่องสัญญาณ] หรืออาจใช้รูปแบบ "NCHW" ซึ่งลำดับการจัดเก็บข้อมูลจะเป็น: [ชุดข้อมูล, ช่องสัญญาณ, ความสูง, ความกว้าง]
- การขยาย: เทนเซอร์ 1 มิติ ความยาว 4 ปัจจัยการขยายสำหรับแต่ละมิติของ
inputหากตั้งค่าเป็น k > 1 จะมีการข้ามเซลล์ k-1 เซลล์ระหว่างแต่ละองค์ประกอบตัวกรองในมิตินั้น ลำดับของมิติจะถูกกำหนดโดยค่าของdata_formatดูรายละเอียดเพิ่มเติมด้านบน การขยายในมิติแบทช์และมิติความลึกต้องเป็น 1
การส่งคืนสินค้า:
-
Output: เทนเซอร์เอาต์พุต
ตัวสร้างและตัวทำลาย | |
|---|---|
DepthwiseConv2dNative (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding) | |
DepthwiseConv2dNative (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const DepthwiseConv2dNative::Attrs & attrs) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
ฟังก์ชันคงที่สาธารณะ | |
|---|---|
DataFormat (StringPiece x) | |
Dilations (const gtl::ArraySlice< int > & x) | |
โครงสร้าง | |
|---|---|
| tensorflow::ops::DepthwiseConv2dNative::Attrs | ตัวเลือกการตั้งค่าแอตทริบิวต์สำหรับ DepthwiseConv2dNative |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output output
หน้าที่สาธารณะ
DepthwiseConv2dNative
DepthwiseConv2dNative( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding )
DepthwiseConv2dNative
DepthwiseConv2dNative( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input filter, const gtl::ArraySlice< int > & strides, StringPiece padding, const DepthwiseConv2dNative::Attrs & attrs )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
รูปแบบข้อมูล
Attrs DataFormat( StringPiece x )
การขยาย
Attrs Dilations( const gtl::ArraySlice< int > & x )