Join the newly launched
Discord community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.model.transformers.CenteringAndScalingTransformer
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ใช้การแปลงการจัดกึ่งกลางและการปรับขนาดกับ Tensor
รับค่าจาก: TensorTransformer
meridian.model.transformers.CenteringAndScalingTransformer(
tensor: tf.Tensor,
population: tf.Tensor,
population_scaling_id: (tf.Tensor | None) = None
)
คลาสนี้แปลง Tensor เพื่อให้ตัวแปรแต่ละตัวมีค่าเป็น 0 และส่วนเบี่ยงเบนมาตรฐานเป็น 1 คุณอาจปรับขนาดแต่ละตัวแปรตามประชากรก่อนที่จะใช้การเปลี่ยนรูปแบบการปรับขนาดและการปรับศูนย์ก็ได้ คลาสจะจัดเก็บค่าเฉลี่ยและค่าเบี่ยงเบนมาตรฐานของตัวแปรแต่ละรายการ
Args |
tensor
|
เทนเซอร์ของมิติข้อมูล (n_geos, n_times, n_channel) ที่ใช้คำนวณค่ามัธยฐานและส่วนเบี่ยงเบนมาตรฐาน
|
population
|
เท็กซัสของมิติข้อมูล (n_geos,) ที่มีประชากรของแต่ละภูมิศาสตร์ ซึ่งใช้ในการคำนวณค่าตัวคูณมาตราส่วน
|
population_scaling_id
|
Tensor บูลีนที่ไม่บังคับของมิติข้อมูล (n_channels,) ที่ระบุตัวแปรที่จะมีการปรับขนาดตามประชากร
|
เมธอด
forward
ดูแหล่งที่มา
forward(
tensor: tf.Tensor
) -> tf.Tensor
ปรับขนาดเทนเซอร์หนึ่งๆ โดยใช้สัมประสิทธิ์ที่จัดเก็บไว้
inverse
ดูแหล่งที่มา
inverse(
tensor: tf.Tensor
) -> tf.Tensor
ปรับขนาดเทนเซอร์ที่ระบุให้เล็กลงโดยใช้ค่าสัมประสิทธิ์ที่เก็บไว้
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-11-14 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2024-11-14 UTC"],[],["This content describes a `CenteringAndScalingTransformer` class that transforms a tensor by centering (mean zero) and scaling (standard deviation one) its variables. It takes a tensor, population data, and an optional population scaling ID as input. The class stores the mean and standard deviation. It has two main methods: `forward`, which applies the scaling to a tensor, and `inverse`, which reverses the scaling using the stored coefficients. The transformations can be applied channel-wise with the `population_scaling_id`.\n"],null,[]]