tensorflow::ops::SegmentMean
#include <math_ops.h>คำนวณค่าเฉลี่ยตามส่วนต่างๆ ของเทนเซอร์
สรุป
โปรดอ่าน หัวข้อเกี่ยวกับการแบ่งกลุ่ม เพื่อดูคำอธิบายเกี่ยวกับกลุ่มต่างๆ
คำนวณเทนเซอร์โดยที่ \(output_i = { data_j}{N}\) โดยที่ mean จะอยู่เหนือค่า j โดยที่ segment_ids[j] == i และ N คือจำนวนค่าทั้งหมดที่นำมาบวกกัน
ถ้าค่าเฉลี่ยว่างเปล่าสำหรับรหัสเซ็กเมนต์ i ที่กำหนด output[i] = 0

ตัวอย่างเช่น:
c = tf.constant([[1.0,2,3,4], [4, 3, 2, 1], [5,6,7,8]]) tf.segment_mean(c, tf.constant([0, 0, 1])) # ==> [[2.5, 2.5, 2.5, 2.5], # [5, 6, 7, 8]]
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- segment_ids: เทนเซอร์ 1 มิติ ที่มีขนาดเท่ากับขนาดของมิติแรกของ
dataค่าต่างๆ ควรเรียงลำดับ และสามารถซ้ำกันได้
การส่งคืนสินค้า:
-
Output: มีรูปร่างเหมือนกับข้อมูล ยกเว้นมิติที่ 0 ซึ่งมีขนาดkซึ่งเป็นจำนวนส่วนย่อย
ตัวสร้างและตัวทำลาย | |
|---|---|
SegmentMean (const :: tensorflow::Scope & scope, :: tensorflow::Input data, :: tensorflow::Input segment_ids) |
คุณลักษณะสาธารณะ | |
|---|---|
operation | |
output | |
หน้าที่สาธารณะ | |
|---|---|
node () const | ::tensorflow::Node * |
operator::tensorflow::Input () const | |
operator::tensorflow::Output () const | |
คุณลักษณะสาธารณะ
การดำเนินการ
Operation operation
เอาต์พุต
::tensorflow::Output output
หน้าที่สาธารณะ
เซ็กเมนต์มีน
SegmentMean( const ::tensorflow::Scope & scope, ::tensorflow::Input data, ::tensorflow::Input segment_ids )
โหนด
::tensorflow::Node * node() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::อินพุต
operator::tensorflow::Input() const
ตัวดำเนินการ::เทนเซอร์โฟลว์::เอาต์พุต
operator::tensorflow::Output() const