جریان تنسور:: عملیات:: ResourceSparseApplyProximalGradientDescent
#include <training_ops.h>
بهروزرسانی پراکنده '*var' به عنوان الگوریتم FOBOS با نرخ یادگیری ثابت.
خلاصه
یعنی برای ردیف هایی که grad داریم، var را به صورت زیر به روز می کنیم: prox_v = var - alpha * grad var = sign(prox_v)/(1+alpha*l2) * max{|prox_v|-alpha*l1,0}
استدلال ها:
- scope: یک شی Scope
- var: باید از یک متغیر () باشد.
- آلفا: ضریب مقیاس. باید اسکالر باشد.
- l1: تنظیم L1. باید اسکالر باشد.
- l2: تنظیم L2. باید اسکالر باشد.
- grad: گرادیان.
- شاخص ها: بردار شاخص ها در بعد اول var و accum.
ویژگی های اختیاری (به Attrs
مراجعه کنید):
- use_locking: اگر True باشد، تفریق با یک قفل محافظت می شود. در غیر این صورت رفتار تعریف نشده است، اما ممکن است اختلاف کمتری از خود نشان دهد.
برمیگرداند:
-
Operation
ایجاد شده
سازندگان و ویرانگرها | |
---|---|
ResourceSparseApplyProximalGradientDescent (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input alpha, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input grad, :: tensorflow::Input indices) | |
ResourceSparseApplyProximalGradientDescent (const :: tensorflow::Scope & scope, :: tensorflow::Input var, :: tensorflow::Input alpha, :: tensorflow::Input l1, :: tensorflow::Input l2, :: tensorflow::Input grad, :: tensorflow::Input indices, const ResourceSparseApplyProximalGradientDescent::Attrs & attrs) |
صفات عمومی | |
---|---|
operation |
توابع عمومی | |
---|---|
operator::tensorflow::Operation () const |
توابع استاتیک عمومی | |
---|---|
UseLocking (bool x) |
سازه ها | |
---|---|
tensorflow:: ops:: ResourceSparseApplyProximalGradientDescent:: Attrs | تنظیم کننده های ویژگی اختیاری برای ResourceSparseApplyProximalGradientDescent . |
صفات عمومی
عملیات
Operation operation
توابع عمومی
ResourceSparseApplyProximalGradientDescent
ResourceSparseApplyProximalGradientDescent( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input alpha, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input grad, ::tensorflow::Input indices )
ResourceSparseApplyProximalGradientDescent
ResourceSparseApplyProximalGradientDescent( const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input alpha, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input grad, ::tensorflow::Input indices, const ResourceSparseApplyProximalGradientDescent::Attrs & attrs )
عملگر::tensorflow::عملیات
operator::tensorflow::Operation() const
توابع استاتیک عمومی
استفاده از قفل
Attrs UseLocking( bool x )
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-07-25 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# tensorflow::ops::ResourceSparseApplyProximalGradientDescent Class Reference\n\ntensorflow::ops::ResourceSparseApplyProximalGradientDescent\n===========================================================\n\n`#include \u003ctraining_ops.h\u003e`\n\nSparse update '\\*var' as FOBOS algorithm with fixed learning rate.\n\nSummary\n-------\n\nThat is for rows we have grad for, we update var as follows: prox_v = var - alpha \\* grad var = sign(prox_v)/(1+alpha\\*l2) \\* max{\\|prox_v\\|-alpha\\*l1,0}\n\nArguments:\n\n- scope: A [Scope](/versions/r1.15/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope) object\n- var: Should be from a Variable().\n- alpha: Scaling factor. Must be a scalar.\n- l1: L1 regularization. Must be a scalar.\n- l2: L2 regularization. Must be a scalar.\n- grad: The gradient.\n- indices: A vector of indices into the first dimension of var and accum.\n\n\u003cbr /\u003e\n\nOptional attributes (see [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs)):\n\n- use_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.\n\n\u003cbr /\u003e\n\nReturns:\n\n- the created [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation)\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [ResourceSparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a045bee13c19911e4f7a40bfe1366c6e1)`(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)` var, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices)` ||\n| [ResourceSparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1afac4191272f3b8d9d42cf0adb1b5427b)`(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)` var, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, ::`[tensorflow::Input](/versions/r1.15/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, const `[ResourceSparseApplyProximalGradientDescent::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|-----------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a378316d23cd77b905128227192e3b10c) | [Operation](/versions/r1.15/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|\n| [operator::tensorflow::Operation](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1ad6ed2bcb828502eb8831b972afe172f3)`() const ` | ` ` ` ` |\n\n| ### Public static functions ||\n|----------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1a9dcb62b192d34bba83cb6cfc7026ee55)`(bool x)` | [Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent_1_1_attrs) |\n\n| ### Structs ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::ResourceSparseApplyProximalGradientDescent::Attrs](/versions/r1.15/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [ResourceSparseApplyProximalGradientDescent](/versions/r1.15/api_docs/cc/class/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_resource_sparse_apply_proximal_gradient_descent). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\nPublic functions\n----------------\n\n### ResourceSparseApplyProximalGradientDescent\n\n```gdscript\n ResourceSparseApplyProximalGradientDescent(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input var,\n ::tensorflow::Input alpha,\n ::tensorflow::Input l1,\n ::tensorflow::Input l2,\n ::tensorflow::Input grad,\n ::tensorflow::Input indices\n)\n``` \n\n### ResourceSparseApplyProximalGradientDescent\n\n```gdscript\n ResourceSparseApplyProximalGradientDescent(\n const ::tensorflow::Scope & scope,\n ::tensorflow::Input var,\n ::tensorflow::Input alpha,\n ::tensorflow::Input l1,\n ::tensorflow::Input l2,\n ::tensorflow::Input grad,\n ::tensorflow::Input indices,\n const ResourceSparseApplyProximalGradientDescent::Attrs & attrs\n)\n``` \n\n### operator::tensorflow::Operation\n\n```gdscript\n operator::tensorflow::Operation() const \n``` \n\nPublic static functions\n-----------------------\n\n### UseLocking\n\n```text\nAttrs UseLocking(\n bool x\n)\n```"]]