Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::ops::SparseApplyProximalGradientDescent
#include <training_ops.h>
Sparse update '*var' as FOBOS algorithm with fixed learning rate.
Summary
That 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}$$
Args:
- scope: A Scope object
- var: Should be from a Variable().
- alpha: Scaling factor. Must be a scalar.
- l1: L1 regularization. Must be a scalar.
- l2: L2 regularization. Must be a scalar.
- grad: The gradient.
- indices: A vector of indices into the first dimension of var and accum.
Optional attributes (see Attrs
):
- use_locking: If True, the subtraction will be protected by a lock; otherwise the behavior is undefined, but may exhibit less contention.
Returns:
Constructors and Destructors
|
SparseApplyProximalGradientDescent(const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input alpha, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input grad, ::tensorflow::Input indices)
|
SparseApplyProximalGradientDescent(const ::tensorflow::Scope & scope, ::tensorflow::Input var, ::tensorflow::Input alpha, ::tensorflow::Input l1, ::tensorflow::Input l2, ::tensorflow::Input grad, ::tensorflow::Input indices, const SparseApplyProximalGradientDescent::Attrs & attrs)
|
Public attributes
Public functions
node
::tensorflow::Node * node() const
operator::tensorflow::Input() const
operator::tensorflow::Output
operator::tensorflow::Output() const
Public static functions
UseLocking
Attrs UseLocking(
bool x
)
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Some content is licensed under the numpy license.
Last updated 2022-02-08 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-02-08 UTC."],[],[],null,["# tensorflow::ops::SparseApplyProximalGradientDescent Class Reference\n\ntensorflow::ops::SparseApplyProximalGradientDescent\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\nArgs:\n\n- scope: A [Scope](/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](/api_docs/cc/struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_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- [Output](/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output): Same as \"var\".\n\n\u003cbr /\u003e\n\n| ### Constructors and Destructors ||\n|---|---|\n| [SparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a372f39ab528e739f2009829f8209517b)`(const ::`[tensorflow::Scope](/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` var, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices)` ||\n| [SparseApplyProximalGradientDescent](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a8ba255097ba97fd395eb2528cf675341)`(const ::`[tensorflow::Scope](/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` var, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, ::`[tensorflow::Input](/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, const `[SparseApplyProximalGradientDescent::Attrs](/api_docs/cc/struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs)` & attrs)` ||\n\n| ### Public attributes ||\n|--------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------|\n| [operation](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a8787a4b4f05f63e721e95dc8c8ae25e6) | [Operation](/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation) |\n| [out](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a0f7e7354d7d857df6ba06081c84b4f97) | `::`[tensorflow::Output](/api_docs/cc/class/tensorflow/output#classtensorflow_1_1_output) |\n\n| ### Public functions ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------|------------------------|\n| [node](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a479c0fc042fbe24ce695f756d8254d0b)`() const ` | `::tensorflow::Node *` |\n| [operator::tensorflow::Input](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1a94b9654761c297155f6b1ad3a8aa86e2)`() const ` | |\n| [operator::tensorflow::Output](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1af963b74c94589fa8d01e7c6731da53f1)`() const ` | |\n\n| ### Public static functions ||\n|-------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [UseLocking](#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1ad1049d2df604f472a032326555f15024)`(bool x)` | [Attrs](/api_docs/cc/struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs#structtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent_1_1_attrs) |\n\n| ### Structs ||\n|-----------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [tensorflow::ops::SparseApplyProximalGradientDescent::Attrs](/api_docs/cc/struct/tensorflow/ops/sparse-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [SparseApplyProximalGradientDescent](/api_docs/cc/class/tensorflow/ops/sparse-apply-proximal-gradient-descent#classtensorflow_1_1ops_1_1_sparse_apply_proximal_gradient_descent). |\n\nPublic attributes\n-----------------\n\n### operation\n\n```text\nOperation operation\n``` \n\n### out\n\n```text\n::tensorflow::Output out\n``` \n\nPublic functions\n----------------\n\n### SparseApplyProximalGradientDescent\n\n```gdscript\n SparseApplyProximalGradientDescent(\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### SparseApplyProximalGradientDescent\n\n```gdscript\n SparseApplyProximalGradientDescent(\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 SparseApplyProximalGradientDescent::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### UseLocking\n\n```text\nAttrs UseLocking(\n bool x\n)\n```"]]