tf.keras.optimizers.Adagrad
Stay organized with collections
Save and categorize content based on your preferences.
Optimizer that implements the Adagrad algorithm.
Inherits From: Optimizer
tf.keras.optimizers.Adagrad(
learning_rate=0.001, initial_accumulator_value=0.1, epsilon=1e-07,
name='Adagrad', **kwargs
)
Adagrad is an optimizer with parameter-specific learning rates,
which are adapted relative to how frequently a parameter gets
updated during training. The more updates a parameter receives,
the smaller the updates.
Args |
learning_rate
|
Initial value for the learning rate:
either a floating point value,
or a tf.keras.optimizers.schedules.LearningRateSchedule instance.
Defaults to 0.001.
Note that Adagrad tends to benefit from higher initial learning rate
values compared to other optimizers.
To match the exact form in the original paper, use 1.0.
|
initial_accumulator_value
|
Floating point value.
Starting value for the accumulators (per-parameter momentum values).
Must be non-negative.
|
epsilon
|
Small floating point value used to maintain numerical stability.
|
name
|
Optional name prefix for the operations created when applying
gradients. Defaults to "Adagrad" .
|
**kwargs
|
Keyword arguments. Allowed to be one of
"clipnorm" or "clipvalue" .
"clipnorm" (float) clips gradients by norm and represents
the maximum L2 norm of each weight variable;
"clipvalue" (float) clips gradient by value and represents the
maximum absolute value of each weight variable.
|
Reference:
Raises |
ValueError
|
in case of any invalid argument.
|
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-05-14 UTC.
[null,null,["Last updated 2021-05-14 UTC."],[],[],null,["# tf.keras.optimizers.Adagrad\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/optimizers/Adagrad) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.5.0/tensorflow/python/keras/optimizer_v2/adagrad.py#L31-L169) |\n\nOptimizer that implements the Adagrad algorithm.\n\nInherits From: [`Optimizer`](../../../tf/keras/optimizers/Optimizer)\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tf.optimizers.Adagrad`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/Adagrad)\n**Compat aliases for migration**\n\nSee\n[Migration guide](https://www.tensorflow.org/guide/migrate) for\nmore details.\n\n[`tf.compat.v1.keras.optimizers.Adagrad`](https://www.tensorflow.org/api_docs/python/tf/keras/optimizers/Adagrad)\n\n\u003cbr /\u003e\n\n tf.keras.optimizers.Adagrad(\n learning_rate=0.001, initial_accumulator_value=0.1, epsilon=1e-07,\n name='Adagrad', **kwargs\n )\n\nAdagrad is an optimizer with parameter-specific learning rates,\nwhich are adapted relative to how frequently a parameter gets\nupdated during training. The more updates a parameter receives,\nthe smaller the updates.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `learning_rate` | Initial value for the learning rate: either a floating point value, or a [`tf.keras.optimizers.schedules.LearningRateSchedule`](../../../tf/keras/optimizers/schedules/LearningRateSchedule) instance. Defaults to 0.001. Note that `Adagrad` tends to benefit from higher initial learning rate values compared to other optimizers. To match the exact form in the original paper, use 1.0. |\n| `initial_accumulator_value` | Floating point value. Starting value for the accumulators (per-parameter momentum values). Must be non-negative. |\n| `epsilon` | Small floating point value used to maintain numerical stability. |\n| `name` | Optional name prefix for the operations created when applying gradients. Defaults to `\"Adagrad\"`. |\n| `**kwargs` | Keyword arguments. Allowed to be one of `\"clipnorm\"` or `\"clipvalue\"`. `\"clipnorm\"` (float) clips gradients by norm and represents the maximum L2 norm of each weight variable; `\"clipvalue\"` (float) clips gradient by value and represents the maximum absolute value of each weight variable. |\n\n\u003cbr /\u003e\n\n#### Reference:\n\n- [Duchi et al., 2011](http://www.jmlr.org/papers/volume12/duchi11a/duchi11a.pdf).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Raises ------ ||\n|--------------|----------------------------------|\n| `ValueError` | in case of any invalid argument. |\n\n\u003cbr /\u003e"]]