tf.keras.experimental.CosineDecay
Stay organized with collections
Save and categorize content based on your preferences.
A LearningRateSchedule that uses a cosine decay schedule.
Inherits From: LearningRateSchedule
tf.keras.experimental.CosineDecay(
initial_learning_rate, decay_steps, alpha=0.0, name=None
)
Args |
initial_learning_rate
|
A scalar float32 or float64 Tensor or a
Python number. The initial learning rate.
|
decay_steps
|
A scalar int32 or int64 Tensor or a Python number.
Number of steps to decay over.
|
alpha
|
A scalar float32 or float64 Tensor or a Python number.
Minimum learning rate value as a fraction of initial_learning_rate.
|
name
|
String. Optional name of the operation. Defaults to 'CosineDecay'.
|
Methods
from_config
View source
@classmethod
from_config(
config
)
Instantiates a LearningRateSchedule
from its config.
Args |
config
|
Output of get_config() .
|
Returns |
A LearningRateSchedule instance.
|
get_config
View source
get_config()
__call__
View source
__call__(
step
)
Call self as a function.
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.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[],null,["# tf.keras.experimental.CosineDecay\n\n\u003cbr /\u003e\n\n|-------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [TensorFlow 1 version](/versions/r1.15/api_docs/python/tf/keras/experimental/CosineDecay) | [View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py#L515-L602) |\n\nA LearningRateSchedule that uses a cosine decay schedule.\n\nInherits From: [`LearningRateSchedule`](../../../tf/keras/optimizers/schedules/LearningRateSchedule)\n\n#### View aliases\n\n\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.experimental.CosineDecay`](/api_docs/python/tf/keras/experimental/CosineDecay)\n\n\u003cbr /\u003e\n\n tf.keras.experimental.CosineDecay(\n initial_learning_rate, decay_steps, alpha=0.0, name=None\n )\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------------|--------------------------------------------------------------------------------------------------------------------------------|\n| `initial_learning_rate` | A scalar `float32` or `float64` Tensor or a Python number. The initial learning rate. |\n| `decay_steps` | A scalar `int32` or `int64` `Tensor` or a Python number. Number of steps to decay over. |\n| `alpha` | A scalar `float32` or `float64` Tensor or a Python number. Minimum learning rate value as a fraction of initial_learning_rate. |\n| `name` | String. Optional name of the operation. Defaults to 'CosineDecay'. |\n\n\u003cbr /\u003e\n\nMethods\n-------\n\n### `from_config`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py#L50-L60) \n\n @classmethod\n from_config(\n config\n )\n\nInstantiates a `LearningRateSchedule` from its config.\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ||\n|----------|---------------------------|\n| `config` | Output of `get_config()`. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ||\n|---|---|\n| A `LearningRateSchedule` instance. ||\n\n\u003cbr /\u003e\n\n### `get_config`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py#L596-L602) \n\n get_config()\n\n### `__call__`\n\n[View source](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/optimizer_v2/learning_rate_schedule.py#L580-L594) \n\n __call__(\n step\n )\n\nCall self as a function."]]