จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
เทนเซอร์โฟลว์:: ปฏิบัติการ:: สุ่มปัวซองV2
#include <random_ops.h>
ส่งออกค่าสุ่มจากการแจกแจงปัวซองที่อธิบายตามอัตรา
สรุป
การดำเนินการนี้ใช้อัลกอริธึมสองตัว ขึ้นอยู่กับอัตรา หากอัตรา >= 10 ดังนั้นอัลกอริทึมของ Hormann จะถูกนำมาใช้เพื่อรับตัวอย่างผ่านการปฏิเสธการแปลงรูป ดู http://www.sciencedirect.com/science/article/pii/0167668793909974
มิฉะนั้น อัลกอริธึมของ Knuth จะถูกนำมาใช้เพื่อรับตัวอย่างโดยการคูณตัวแปรสุ่มที่สม่ำเสมอ ดูโดนัลด์ อี. คนุธ (1969) อัลกอริทึมแบบกึ่งตัวเลข ศิลปะแห่งการเขียนโปรแกรมคอมพิวเตอร์ เล่มที่ 2 แอดดิสัน เวสลีย์
ข้อโต้แย้ง:
- ขอบเขต: วัตถุ ขอบเขต
- รูปร่าง: เทนเซอร์จำนวนเต็ม 1-D รูปร่างของตัวอย่างอิสระที่จะดึงจากการแจกแจงแต่ละครั้ง อธิบายโดยพารามิเตอร์รูปร่างที่กำหนดในอัตรา
- อัตรา: เทนเซอร์ที่แต่ละสเกลาร์เป็นพารามิเตอร์ "อัตรา" ที่อธิบายการแจกแจงปัวซองที่เกี่ยวข้อง
แอ็ตทริบิวต์ทางเลือก (ดู Attrs
):
- เมล็ด: หาก
seed
ใดเมล็ดหนึ่งหรือ seed2
ถูกตั้งค่าไม่เป็นศูนย์ เครื่องกำเนิดตัวเลขสุ่มจะถูกเพาะโดยเมล็ดที่กำหนด มิฉะนั้นจะถูกเพาะโดยเมล็ดแบบสุ่ม - seed2: เมล็ดที่สองเพื่อหลีกเลี่ยงการชนกันของเมล็ด
ผลตอบแทน:
-
Output
: เทนเซอร์ที่มีรูปร่าง shape + shape(rate)
แต่ละชิ้น [:, ..., :, i0, i1, ...iN]
มีตัวอย่างที่วาดไว้สำหรับ rate[i0, i1, ...iN]
ฟังก์ชันคงที่สาธารณะ |
---|
Dtype (DataType x) | |
Seed (int64 x) | |
Seed2 (int64 x) | |
คุณลักษณะสาธารณะ
งานสาธารณะ
โหนด
::tensorflow::Node * node() const
operator::tensorflow::Input() const
ตัวดำเนินการ::tensorflow::เอาต์พุต
operator::tensorflow::Output() const
ฟังก์ชันคงที่สาธารณะ
ประเภทD
Attrs Dtype(
DataType x
)
เมล็ดพันธุ์
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::RandomPoissonV2 Class Reference\n\ntensorflow::ops::RandomPoissonV2\n================================\n\n`#include \u003crandom_ops.h\u003e`\n\nOutputs random values from the Poisson distribution(s) described by rate.\n\nSummary\n-------\n\nThis op uses two algorithms, depending on rate. If rate \\\u003e= 10, then the algorithm by Hormann is used to acquire samples via transformation-rejection. See \u003chttp://www.sciencedirect.com/science/article/pii/0167668793909974\u003e.\n\nOtherwise, Knuth's algorithm is used to acquire samples via multiplying uniform random variables. See Donald E. Knuth (1969). Seminumerical Algorithms. The Art of Computer Programming, Volume 2. Addison Wesley\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- shape: 1-D integer tensor. Shape of independent samples to draw from each distribution described by the shape parameters given in rate.\n- rate: A tensor in which each scalar is a \"rate\" parameter describing the associated poisson distribution.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_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 with shape `shape + shape(rate)`. Each slice `[:, ..., :, i0, i1, ...iN]` contains the samples drawn for `rate[i0, i1, ...iN]`.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [RandomPoissonV2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1ac6781b746b5d655d44cf7298d0ec0e8d)`(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, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rate)` ||\n| [RandomPoissonV2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1affe491853f03c22d0d69fe155380690d)`(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, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` rate, const `[RandomPoissonV2::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a8a6d22a45ef402122008fd37ae60584a) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [output](#classtensorflow_1_1ops_1_1_random_poisson_v2_1aacc4e0f70e7215919fd2ed050cc778ec) | `::`[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_random_poisson_v2_1a2c4c1c5791ce65536c0711c345c5104f)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a680111c81759da8f485b7c57830a97c8)`() const ` | ` ` ` ` |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_random_poisson_v2_1ab0e8e0cee5576ad5d628eb26db934fc6)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|---------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------|\n| [Dtype](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a16ea2843b7cb14092e392a1634d5f9d3)`(DataType x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs) |\n| [Seed](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a4923276f993adff27a39549f725e140c)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_random_poisson_v2_1a3db3d3b1dcf6fd61014a43d46719c992)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs#structtensorflow_1_1ops_1_1_random_poisson_v2_1_1_attrs) |\n\n| ### Structs ||\n|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::RandomPoissonV2::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/random-poisson-v2/attrs) | Optional attribute setters for [RandomPoissonV2](/versions/r1.15/api_docs/cc/class/tensorflow/ops/random-poisson-v2#classtensorflow_1_1ops_1_1_random_poisson_v2). |\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### RandomPoissonV2\n\n```gdscript\n RandomPoissonV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n ::tensorflow::Input rate\n)\n``` \n\n### RandomPoissonV2\n\n```gdscript\n RandomPoissonV2(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input shape,\n ::tensorflow::Input rate,\n const RandomPoissonV2::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### Dtype\n\n```carbon\nAttrs Dtype(\n DataType x\n)\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```"]]