tensorflow::ops::SparseFillEmptyRows

#include <sparse_ops.h>

เติมค่าเริ่มต้นลงในแถวว่างใน SparseTensor แบบ 2 มิติที่ป้อนเข้ามา

สรุป

เท SparseTensor (SparseTensor) ที่เป็นอินพุตจะถูกแสดงด้วยทูเปิลของอินพุต ( indices , values , dense_shape ) SparseTensor เป็นเอาต์พุตจะมี dense_shape เหมือนเดิม แต่จะมีดัชนี output_indices และค่า output_values

การดำเนินการนี้จะแทรกรายการเดียวสำหรับทุกแถวที่ไม่มีค่าใดๆ โดยจะสร้างดัชนีเป็น [row, 0, ..., 0] และค่าที่แทรกคือ default_value

ตัวอย่างเช่น สมมติว่า sp_input มีรูปร่าง [5, 6] และมีค่าที่ไม่ว่างเปล่า:

[0, 1]: a
[0, 3]: b
[2, 0]: c
[3, 1]: d

แถวที่ 1 และ 4 ว่างเปล่า ดังนั้นผลลัพธ์จะมีรูปร่าง [5, 6] โดยมีค่าดังนี้:

[0, 1]: a
[0, 3]: b
[1, 0]: default_value
[2, 0]: c
[3, 1]: d
[4, 0]: default_value

ผลลัพธ์ของ SparseTensor จะอยู่ในลำดับแบบ row-major และจะมีรูปร่างเหมือนกับอินพุต

โอเปอเรเตอร์นี้ยังส่งคืนเวกเตอร์ตัวบ่งชี้ที่มีรูปร่าง [dense_shape[0]] เช่นกัน

empty_row_indicator[i] = True iff row i was an empty row.

และเวกเตอร์แผนที่ดัชนีย้อนกลับที่มีรูปร่าง [indices.shape[0]] ซึ่งใช้ในระหว่างการย้อนกลับการแพร่กระจาย

reverse_index_map[j] = out_j s.t. indices[j, :] == output_indices[out_j, :]

ข้อโต้แย้ง:

  • ขอบเขต: วัตถุ ขอบเขต
  • ดัชนี: 2 มิติ ดัชนีของเทนเซอร์แบบเบาบาง
  • ค่า: 1 มิติ ค่าของเทนเซอร์แบบเบาบาง
  • dense_shape: 1 มิติ รูปทรงของเทนเซอร์แบบเบาบาง
  • default_value: 0 มิติ ค่าเริ่มต้นที่จะแทรกเข้าไปในตำแหน่ง [row, 0, ..., 0] สำหรับแถวที่หายไปจากเทนเซอร์แบบสปาร์สที่ป้อนเข้ามา output indices: 2 มิติ ดัชนีของเทนเซอร์แบบสปาร์สที่เติมเต็มแล้ว

การส่งคืนสินค้า:

  • Output output_indices
  • ค่า Output : ค่า 1 มิติของเทนเซอร์แบบสปาร์สที่เติมเต็มแล้ว
  • ตัวบ่งชี้แถวว่างที่ Output : 1 มิติ ระบุว่าแถวหนาแน่นหายไปในเทนเซอร์แบบเบาบางที่ป้อนเข้ามาหรือไม่
  • Output reverse_index_map: แผนที่ 1 มิติ จากดัชนีอินพุตไปยังดัชนีเอาต์พุต

ตัวสร้างและตัวทำลาย

SparseFillEmptyRows (const :: tensorflow::Scope & scope, :: tensorflow::Input indices, :: tensorflow::Input values, :: tensorflow::Input dense_shape, :: tensorflow::Input default_value)

คุณลักษณะสาธารณะ

empty_row_indicator
operation
output_indices
output_values
reverse_index_map

คุณลักษณะสาธารณะ

ตัวบ่งชี้แถวว่าง

::tensorflow::Output empty_row_indicator

การดำเนินการ

Operation operation

ดัชนีเอาต์พุต

::tensorflow::Output output_indices

ค่าเอาต์พุต

::tensorflow::Output output_values

แผนที่ดัชนีย้อนกลับ

::tensorflow::Output reverse_index_map

หน้าที่สาธารณะ

เติมแถวว่างแบบเบาบาง

 SparseFillEmptyRows(
  const ::tensorflow::Scope & scope,
  ::tensorflow::Input indices,
  ::tensorflow::Input values,
  ::tensorflow::Input dense_shape,
  ::tensorflow::Input default_value
)