Stay organized with collections
Save and categorize content based on your preferences.
tensorflow::
ops::
ResourceSparseApplyProximalGradientDescent
#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
|
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)
|
Public attributes
Public functions
operator::tensorflow::Operation
operator::tensorflow::Operation() 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 2021-08-16 UTC.
[null,null,["Last updated 2021-08-16 UTC."],[],[],null,["# tensorflow::ops::ResourceSparseApplyProximalGradientDescent Class Reference\n\ntensorflow::\nops::\nResourceSparseApplyProximalGradientDescent\n=============================================================\n\n`\n#include \u003ctraining_ops.h\u003e\n`\n\n\nSparse update '\\*var' as FOBOS algorithm with fixed learning rate.\n\nSummary\n-------\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\n\nArgs:\n\n- scope: A [Scope](/versions/r2.6/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\n\nOptional attributes (see\n`\n`[Attrs](/versions/r2.6/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):\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\n\nReturns:\n\n- the created `\n `[Operation](/versions/r2.6/api_docs/cc/class/tensorflow/operation#classtensorflow_1_1_operation)`\n `\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/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` var, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, :: `[tensorflow::Input](/versions/r2.6/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/r2.6/api_docs/cc/class/tensorflow/scope#classtensorflow_1_1_scope)` & scope, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` var, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` alpha, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l1, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` l2, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` grad, :: `[tensorflow::Input](/versions/r2.6/api_docs/cc/class/tensorflow/input#classtensorflow_1_1_input)` indices, const `[ResourceSparseApplyProximalGradientDescent::Attrs](/versions/r2.6/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/r2.6/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/r2.6/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/r2.6/api_docs/cc/struct/tensorflow/ops/resource-sparse-apply-proximal-gradient-descent/attrs) | Optional attribute setters for [ResourceSparseApplyProximalGradientDescent](/versions/r2.6/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```"]]