จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: ถูกตัดทอนปกติ
#include <random_ops.h>
ส่งออกค่าสุ่มจากการแจกแจงแบบปกติที่ถูกตัดทอน
สรุป
ค่าที่สร้างขึ้นเป็นไปตามการแจกแจงแบบปกติโดยมีค่าเฉลี่ย 0 และค่าเบี่ยงเบนมาตรฐาน 1 ยกเว้นว่าค่าที่มีขนาดมากกว่า 2 ส่วนเบี่ยงเบนมาตรฐานจากค่าเฉลี่ยจะถูกละทิ้งและเลือกใหม่
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- รูปร่าง: รูปร่างของเทนเซอร์เอาท์พุต
- dtype: ประเภทของเอาต์พุต
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- เมล็ด: หาก
seed
ใดเมล็ดหนึ่งหรือ seed2
ถูกตั้งค่าไม่เป็นศูนย์ เครื่องกำเนิดตัวเลขสุ่มจะถูกเพาะโดยเมล็ดที่กำหนด มิฉะนั้นจะถูกเพาะโดยเมล็ดแบบสุ่ม - seed2: เมล็ดที่สองเพื่อหลีกเลี่ยงการชนกันของเมล็ด
ผลตอบแทน:
-
Output
: เทนเซอร์ของรูปร่างที่ระบุซึ่งเต็มไปด้วยค่าปกติที่ถูกตัดทอนแบบสุ่ม
ฟังก์ชันคงที่สาธารณะ |
---|
Seed (int64 x) | |
Seed2 (int64 x) | |
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
เมล็ดพันธุ์
Attrs Seed(
int64 x
)
เมล็ดพันธุ์2
Attrs Seed2(
int64 x
)
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-26 UTC
[null,null,["อัปเดตล่าสุด 2025-07-26 UTC"],[],[],null,["# tensorflow::ops::TruncatedNormal Class Reference\n\ntensorflow::ops::TruncatedNormal\n================================\n\n`#include \u003crandom_ops.h\u003e`\n\nOutputs random values from a truncated normal distribution.\n\nSummary\n-------\n\nThe generated values follow a normal distribution with mean 0 and standard deviation 1, except that values whose magnitude is more than 2 standard deviations from the mean are dropped and re-picked.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: The shape of the output tensor.\n- dtype: The type of the output.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)):\n\n- seed: If either `seed` or `seed2` are set to be non-zero, the random number generator is seeded by the given seed. Otherwise, it is seeded by a random seed.\n- seed2: A second seed to avoid seed collision.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): A tensor of the specified shape filled with random truncated normal values.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [TruncatedNormal](#classtensorflow_1_1ops_1_1_truncated_normal_1affc5d8efb95031e4d6866afea6db4885)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, DataType dtype)` ||\n| [TruncatedNormal](#classtensorflow_1_1ops_1_1_truncated_normal_1a0c16f49d32f82c76b2f48fe989d40ede)`(const ::`[tensorflow::Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` shape, DataType dtype, const `[TruncatedNormal::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_truncated_normal_1a94e86733620c725cfd18c220e7befc91) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_truncated_normal_1ab70e3146207138655b0a57215318f04a) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|----------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_truncated_normal_1a1a306e31c92dabe3e30540b020a5d2cd)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_truncated_normal_1a2ad5d4b0f4e2b937af0d1f4b903fec79)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_truncated_normal_1a1e4ef0edec5a8828733bb2a0b7ba01e0)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|-----------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|\n| [Seed](#classtensorflow_1_1ops_1_1_truncated_normal_1a16a37eaf4346dae9789c2dcadf2bd7cc)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_truncated_normal_1a678db3a004d1f6bdd50b02a65ca1efc6)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/truncated-normal/attrs#structtensorflow_1_1ops_1_1_truncated_normal_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::TruncatedNormal::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/truncated-normal/attrs) | Optional attribute setters for [TruncatedNormal](/versions/r1.15/api_docs/cc/class/tensorflow/ops/truncated-normal#classtensorflow_1_1ops_1_1_truncated_normal). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### output\n\n```text\n::tensorflow::Output output\n``` \n\nPublic functions\n----------------\n\n### TruncatedNormal\n\n```gdscript\n TruncatedNormal(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n DataType dtype\n)\n``` \n\n### TruncatedNormal\n\n```gdscript\n TruncatedNormal(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n DataType dtype,\n const TruncatedNormal::Attrs & attrs\n)\n``` \n\n### node\n\n```gdscript\n::tensorflow::Node * node() const \n``` \n\n### operator::tensorflow::Input\n\n```gdscript\n operator::tensorflow::Input() const \n``` \n\n### operator::tensorflow::Output\n\n```gdscript\n operator::tensorflow::Output() const \n``` \n\nPublic static functions\n-----------------------\n\n### Seed\n\n```text\nAttrs Seed(\n int64 x\n)\n``` \n\n### Seed2\n\n```text\nAttrs Seed2(\n int64 x\n)\n```"]]