تدفق التوتر:: العمليات:: المتراكم المتناثر TakeGradient
#include <data_flow_ops.h>
يستخرج متوسط التدرج المتناثر في SparseConditionalAccumulator .
ملخص
سيتم حظر العملية حتى يتم تجميع التدرجات الكافية (أي أكثر من num_required). إذا قام المجمع بالفعل بتجميع أكثر من num_required من التدرجات، فسوف يُرجع متوسط التدرجات المتراكمة. كما يقوم أيضًا تلقائيًا بزيادة global_step المسجلة في المجمع بمقدار 1، ويعيد تعيين التجميع إلى 0.
الحجج:
- النطاق: كائن النطاق
- المقبض: المقبض الخاص بـ SparseConditionalAccumulator .
- num_required: عدد التدرجات المطلوبة قبل أن نعيد إجماليًا.
- dtype: نوع بيانات التدرجات المتراكمة. يجب أن يتوافق مع نوع المجمع.
العوائد:
- مؤشرات
Output
: مؤشرات متوسط التدرجات المتناثرة المتراكمة. - قيم
Output
: قيم متوسط التدرجات المتفرقة المتراكمة. - شكل
Output
: شكل متوسط التدرجات المتفرقة المتراكمة.
البنائين والمدمرين | |
---|---|
SparseAccumulatorTakeGradient (const :: tensorflow::Scope & scope, :: tensorflow::Input handle, :: tensorflow::Input num_required, DataType dtype) |
الصفات العامة | |
---|---|
indices | |
operation | |
shape | |
values |
الصفات العامة
المؤشرات
::tensorflow::Output indices
عملية
Operation operation
شكل
::tensorflow::Output shape
قيم
::tensorflow::Output values
الوظائف العامة
المتراكم المتناثر TakeGradient
SparseAccumulatorTakeGradient( const ::tensorflow::Scope & scope, ::tensorflow::Input handle, ::tensorflow::Input num_required, DataType dtype )
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# tensorflow::ops::SparseAccumulatorTakeGradient Class Reference\n\ntensorflow::ops::SparseAccumulatorTakeGradient\n==============================================\n\n`#include \u003cdata_flow_ops.h\u003e`\n\nExtracts the average sparse gradient in a [SparseConditionalAccumulator](/versions/r2.0/api_docs/cc/class/tensorflow/ops/sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator).\n\nSummary\n-------\n\nThe op will blocks until sufficient (i.e., more than num_required) gradients have been accumulated. If the accumulator has already aggregated more than num_required gradients, it will return its average of the accumulated gradients. Also automatically increments the recorded global_step in the accumulator by 1, and resets the aggregate to 0.\n\nArguments:\n\n- scope: A [Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- handle: The handle to a [SparseConditionalAccumulator](/versions/r2.0/api_docs/cc/class/tensorflow/ops/sparse-conditional-accumulator#classtensorflow_1_1ops_1_1_sparse_conditional_accumulator).\n- num_required: Number of gradients required before we return an aggregate.\n- dtype: The data type of accumulated gradients. Needs to correspond to the type of the accumulator.\n\n\u003cbr /\u003e\n\nReturns:\n\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) indices: Indices of the average of the accumulated sparse gradients.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) values: Values of the average of the accumulated sparse gradients.\n- [Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) shape: Shape of the average of the accumulated sparse gradients.\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseAccumulatorTakeGradient](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a54dc667e3f29216b387adf94e4ef4e18)`(const ::`[tensorflow::Scope](/versions/r2.0/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` handle, ::`[tensorflow::Input](/versions/r2.0/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` num_required, DataType dtype)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|\n| [indices](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1aa27589031abec3face075eee8e143f70) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [operation](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a33f81e771ced8ac821e9176f8d8de2ef) | [Operation](/versions/r2.0/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [shape](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1abaf43bc2f46333ed065180b5a922c901) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n| [values](#classtensorflow_1_1ops_1_1_sparse_accumulator_take_gradient_1a0aec4d550ca79eebbf67045528376cbf) | `::`[tensorflow::Output](/versions/r2.0/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\nPublic attributes\n-----------------\n\n### indices\n\n```text\n::tensorflow::Output indices\n``` \n\n### operation\n\n```text\nOperation operation\n``` \n\n### shape\n\n```text\n::tensorflow::Output shape\n``` \n\n### values\n\n```text\n::tensorflow::Output values\n``` \n\nPublic functions\n----------------\n\n### SparseAccumulatorTakeGradient\n\n```gdscript\n SparseAccumulatorTakeGradient(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input handle,\n ::tensorflow::Input num_required,\n DataType dtype\n)\n```"]]