সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
#include <candidate_sampling_ops.h>
লগ-ইউনিফর্ম ডিস্ট্রিবিউশন সহ প্রার্থীর নমুনা নেওয়ার জন্য লেবেল তৈরি করে।
সারাংশ
go/candidate-sampling-এ প্রার্থীর নমুনা এবং ডেটা ফর্ম্যাটের ব্যাখ্যা দেখুন।
প্রতিটি ব্যাচের জন্য, এই অপশনটি নমুনাযুক্ত প্রার্থী লেবেলের একক সেট বেছে নেয়।
প্রতি-ব্যাচ প্রার্থীদের নমুনা নেওয়ার সুবিধাগুলি হল সরলতা এবং দক্ষ ঘন ম্যাট্রিক্স গুণনের সম্ভাবনা। অসুবিধা হল যে নমুনা প্রার্থীদের অবশ্যই প্রসঙ্গ এবং সত্যিকারের লেবেল থেকে স্বাধীনভাবে বেছে নিতে হবে।
যুক্তি:
- স্কোপ: একটি স্কোপ অবজেক্ট
- true_classes: একটি ব্যাচ_সাইজ * num_true ম্যাট্রিক্স, যার প্রতিটি সারিতে সংশ্লিষ্ট মূল লেবেলে num_true টার্গেট_ক্লাসের আইডি রয়েছে।
- num_true: প্রসঙ্গ প্রতি সত্য লেবেলের সংখ্যা।
- num_sampled: এলোমেলোভাবে নমুনা দেওয়ার জন্য প্রার্থীদের সংখ্যা।
- অনন্য: অনন্য সত্য হলে, আমরা প্রত্যাখ্যান সহ নমুনা করি, যাতে একটি ব্যাচের সমস্ত নমুনা প্রার্থী অনন্য হয়। প্রত্যাখ্যান পরবর্তী নমুনা সম্ভাব্যতা অনুমান করার জন্য এটি কিছু আনুমানিক প্রয়োজন।
- range_max: নমুনাকারী ব্যবধান থেকে পূর্ণসংখ্যার নমুনা করবে [0, range_max)।
ঐচ্ছিক বৈশিষ্ট্য (দেখুন Attrs
):
- বীজ: যদি বীজ বা বীজ2 অ-শূন্য সেট করা হয়, তাহলে প্রদত্ত বীজ দ্বারা এলোমেলো সংখ্যা জেনারেটর বীজ হয়। অন্যথায়, এটি একটি এলোমেলো বীজ দ্বারা বীজ হয়।
- বীজ 2: বীজ সংঘর্ষ এড়াতে একটি দ্বিতীয় বীজ।
রিটার্ন:
-
Output
স্যাম্পলড_ক্যান্ডিডেটস: দৈর্ঘ্যের একটি ভেক্টর num_sampled, যেখানে প্রতিটি উপাদান হল একজন নমুনা প্রার্থীর ID। -
Output
true_expected_count: একটি ব্যাচ_সাইজ * num_true ম্যাট্রিক্স, নমুনা নেওয়া প্রার্থীদের একটি ব্যাচে প্রতিটি প্রার্থী কতবার ঘটতে পারে তা প্রতিনিধিত্ব করে। যদি অনন্য = সত্য, তাহলে এটি একটি সম্ভাবনা। -
Output
স্যাম্পলড_প্রত্যাশিত_গণনা: দৈর্ঘ্যের একটি ভেক্টর num_sampled, প্রতিটি নমুনা প্রার্থীর জন্য নমুনা নেওয়া প্রার্থীদের একটি ব্যাচে কতবার প্রার্থী হওয়ার প্রত্যাশিত সংখ্যা প্রতিনিধিত্ব করে। যদি অনন্য = সত্য, তাহলে এটি একটি সম্ভাবনা।
কনস্ট্রাক্টর এবং ডেস্ট্রাক্টর |
---|
LogUniformCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)
|
LogUniformCandidateSampler (const :: tensorflow::Scope & scope, :: tensorflow::Input true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const LogUniformCandidateSampler::Attrs & attrs) |
পাবলিক স্ট্যাটিক ফাংশন |
---|
Seed (int64 x) | |
Seed2 (int64 x) | |
পাবলিক বৈশিষ্ট্য
পাবলিক ফাংশন
পাবলিক স্ট্যাটিক ফাংশন
অন্য কিছু উল্লেখ না করা থাকলে, এই পৃষ্ঠার কন্টেন্ট Creative Commons Attribution 4.0 License-এর অধীনে এবং কোডের নমুনাগুলি Apache 2.0 License-এর অধীনে লাইসেন্স প্রাপ্ত। আরও জানতে, Google Developers সাইট নীতি দেখুন। Java হল Oracle এবং/অথবা তার অ্যাফিলিয়েট সংস্থার রেজিস্টার্ড ট্রেডমার্ক।
2025-07-26 UTC-তে শেষবার আপডেট করা হয়েছে।
[null,null,["2025-07-26 UTC-তে শেষবার আপডেট করা হয়েছে।"],[],[],null,["# tensorflow::ops::LogUniformCandidateSampler Class Reference\n\ntensorflow::ops::LogUniformCandidateSampler\n===========================================\n\n`#include \u003ccandidate_sampling_ops.h\u003e`\n\nGenerates labels for candidate sampling with a log-uniform distribution.\n\nSummary\n-------\n\nSee explanations of candidate sampling and the data formats at go/candidate-sampling.\n\nFor each batch, this op picks a single set of sampled candidate labels.\n\nThe advantages of sampling candidates per-batch are simplicity and the possibility of efficient dense matrix multiplication. The disadvantage is that the sampled candidates must be chosen independently of the context and of the true labels.\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- true_classes: A batch_size \\* num_true matrix, in which each row contains the IDs of the num_true target_classes in the corresponding original label.\n- num_true: Number of true labels per context.\n- num_sampled: Number of candidates to randomly sample.\n- unique: If unique is true, we sample with rejection, so that all sampled candidates in a batch are unique. This requires some approximation to estimate the post-rejection sampling probabilities.\n- range_max: The sampler will sample integers from the interval \\[0, range_max).\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_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: An 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) sampled_candidates: A vector of length num_sampled, in which each element is the ID of a sampled candidate.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) true_expected_count: A batch_size \\* num_true matrix, representing the number of times each candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.\n- [Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) sampled_expected_count: A vector of length num_sampled, for each sampled candidate representing the number of times the candidate is expected to occur in a batch of sampled candidates. If unique=true, then this is a probability.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [LogUniformCandidateSampler](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a53decbe73badf37e773a6e751809f64e)`(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)` true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max)` ||\n| [LogUniformCandidateSampler](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a5c61a7307f78f73a2e8dce57c971daa2)`(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)` true_classes, int64 num_true, int64 num_sampled, bool unique, int64 range_max, const `[LogUniformCandidateSampler::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1aa51b20a7e281994aa03e15cf000e8187) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [sampled_candidates](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a274f630ba32adfbc046a9b365ee0a2c2) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [sampled_expected_count](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1acb096bb548c1449d866d0707cc1fc8fd) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [true_expected_count](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a026cc7983c694439724e84f86e776572) | `::`[tensorflow::Output](/versions/r1.15/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public static functions ||\n|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Seed](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1adff11ef65461633e2c9d8a1232a6f1a3)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs) |\n| [Seed2](#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1a55dcb7900bb164943bf67092b172fbb6)`(int64 x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/log-uniform-candidate-sampler/attrs#structtensorflow_1_1ops_1_1_log_uniform_candidate_sampler_1_1_attrs) |\n\n| ### Structs ||\n|---------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::LogUniformCandidateSampler::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/log-uniform-candidate-sampler/attrs) | Optional attribute setters for [LogUniformCandidateSampler](/versions/r1.15/api_docs/cc/class/tensorflow/ops/log-uniform-candidate-sampler#classtensorflow_1_1ops_1_1_log_uniform_candidate_sampler). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### sampled_candidates\n\n```scdoc\n::tensorflow::Output sampled_candidates\n``` \n\n### sampled_expected_count\n\n```scdoc\n::tensorflow::Output sampled_expected_count\n``` \n\n### true_expected_count\n\n```scdoc\n::tensorflow::Output true_expected_count\n``` \n\nPublic functions\n----------------\n\n### LogUniformCandidateSampler\n\n```gdscript\n LogUniformCandidateSampler(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input true_classes,\n int64 num_true,\n int64 num_sampled,\n bool unique,\n int64 range_max\n)\n``` \n\n### LogUniformCandidateSampler\n\n```gdscript\n LogUniformCandidateSampler(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input true_classes,\n int64 num_true,\n int64 num_sampled,\n bool unique,\n int64 range_max,\n const LogUniformCandidateSampler::Attrs & attrs\n)\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```"]]