<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/models/blob/v2.20.0/official/modeling/optimization/lr_schedule.py#L392-L490) |

Stepwise cosine learning rate decay with offset.

#### View aliases


**Main aliases**

[`tfm.optimization.lr_schedule.StepCosineDecayWithOffset`](https://www.tensorflow.org/api_docs/python/tfm/optimization/StepCosineDecayWithOffset)

<br />

    tfm.optimization.StepCosineDecayWithOffset(
        boundaries,
        values,
        offset: int = 0,
        name: str = 'StepCosineDecayWithOffset'
    )

Learning rate is equivalent to one or more cosine decay(s) starting and
ending at each interval.

ExampleL

      boundaries: [100000, 110000]
      values: [1.0, 0.5]
      lr_decayed_fn = (
      lr_schedule.StepCosineDecayWithOffset(
          boundaries,
          values))

from 0 to 100000 step, it will cosine decay from 1.0 to 0.5
from 100000 to 110000 step, it cosine decay from 0.5 to 0.0

<br />

<br />

<br />

| ## Args ||
|---|---|
| `boundaries` | A list of `Tensor`s or `int`s with strictly increasing entries, and with all elements having the same type as the optimizer step. |
| `values` | A list of `Tensor`s or `float`s that specifies the values for the intervals defined by `boundaries`. It should have one more element than `boundaries`, and all elements should have the same type. |
| `offset` | The offset when computing the power decay. |
| `name` | Optional, name of learning rate schedule. |

<br />

## Methods

### `from_config`

    @classmethod
    from_config(
        config
    )

Instantiates a `LearningRateSchedule` from its config.

<br />

<br />

<br />

| Args ||
|---|---|
| `config` | Output of `get_config()`. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| A `LearningRateSchedule` instance. ||

<br />

### `get_config`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/modeling/optimization/lr_schedule.py#L484-L490)

    get_config()

### `__call__`

[View source](https://github.com/tensorflow/models/blob/v2.20.0/official/modeling/optimization/lr_schedule.py#L449-L482)

    __call__(
        global_step
    )

Call self as a function.