tensorflow::ops::BatchToSpace
#include <array_ops.h>BatchToSpace สำหรับเทนเซอร์ 4 มิติชนิด T
สรุป
นี่คือเวอร์ชันเก่าของ ฟังก์ชัน BatchToSpaceND ที่ใช้งานได้ทั่วไปมากกว่า
จัดเรียง (สลับตำแหน่ง) ข้อมูลจากชุดข้อมูลเป็นบล็อกข้อมูลเชิงพื้นที่ จากนั้นจึงทำการตัดขอบ นี่คือการแปลงแบบย้อนกลับของ SpaceToBatch โดยเฉพาะอย่างยิ่ง การดำเนินการนี้จะส่งออกสำเนาของเทนเซอร์อินพุต โดยที่ค่าจากมิติของ batch จะถูกย้ายไปยังบล็อกเชิงพื้นที่ในมิติ height และความ width จากนั้นจึงทำการตัดขอบตามมิติ height และ width
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- อินพุต: เทนเซอร์ 4 มิติ ที่มีรูปร่าง
[batch*block_size*block_size, height_pad/block_size, width_pad/block_size, depth]โปรดทราบว่าขนาดแบทช์ของเทนเซอร์อินพุตต้องหารลงตัวด้วยblock_size * block_size - crops: 2-D tensor of non-negative integers with shape
[2, 2]. It specifies how many elements to crop from the intermediate result across the spatial dimensions as follows:crops = [[crop_top, crop_bottom], [crop_left, crop_right]]
การส่งคืนสินค้า:
-
Output: รูปทรง 4 มิติ[batch, height, width, depth]โดยที่:height = height_pad - crop_top - crop_bottom width = width_pad - crop_left - crop_right
ค่า block_size ต้องมากกว่าหนึ่ง ค่านี้ระบุขนาดของบล็อก
ตัวอย่างบางส่วน:
(1) สำหรับอินพุตต่อไปนี้ที่มีรูปร่าง [4, 1, 1, 1] และ block_size เท่ากับ 2:
[[[[1]]], [[[2]]], [[[3]]], [[[4]]]]
เทนเซอร์เอาต์พุตมีรูปร่าง [1, 2, 2, 1] และค่า:
x = [[[[1], [2]], [[3], [4]]]]
(2) สำหรับอินพุตต่อไปนี้ที่มีรูปร่าง [4, 1, 1, 3] และ block_size เท่ากับ 2:
[[[[1, 2, 3]]], [[[4, 5, 6]]], [[[7, 8, 9]]], [[[10, 11, 12]]]]
เทนเซอร์เอาต์พุตมีรูปร่าง [1, 2, 2, 3] และค่า:
x = [[[[1, 2, 3], [4, 5, 6]],
[[7, 8, 9], [10, 11, 12]]]] (3) สำหรับอินพุตต่อไปนี้ที่มีรูปร่าง [4, 2, 2, 1] และ block_size เท่ากับ 2:
x = [[[[1], [3]], [[9], [11]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]] เทนเซอร์เอาต์พุตมีรูปร่าง [1, 4, 4, 1] และค่า:
x = [[[[1], [2], [3], [4]],
[[5], [6], [7], [8]],
[[9], [10], [11], [12]],
[[13], [14], [15], [16]]]] (4) สำหรับอินพุตต่อไปนี้ที่มีรูปร่าง [8, 1, 2, 1] และ block_size เท่ากับ 2:
x = [[[[1], [3]]], [[[9], [11]]], [[[2], [4]]], [[[10], [12]]],
[[[5], [7]]], [[[13], [15]]], [[[6], [8]]], [[[14], [16]]]] เทนเซอร์เอาต์พุตมีรูปร่าง [2, 2, 4, 1] และค่า:
x = [[[[1], [3]], [[5], [7]]],
[[[2], [4]], [[10], [12]]],
[[[5], [7]], [[13], [15]]],
[[[6], [8]], [[14], [16]]]]ตัวสร้างและตัวทำลาย | |
|---|---|
BatchToSpace (const :: tensorflow::Scope & scope, :: tensorflow::Input input, :: tensorflow::Input crops, int64 block_size) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output output
หน้าที่สาธารณะ
แบตช์ทูสเปซ
BatchToSpace( const ::tensorflow::Scope & scope, ::tensorflow::Input input, ::tensorflow::Input crops, int64 block_size )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const