# tf_agents.train.triggers.StepPerSecondLogTrigger

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/train/triggers.py#L201-L235) |

Logs train_steps_per_second.

Inherits From: [`IntervalTrigger`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/train/interval_trigger/IntervalTrigger)

    tf_agents.train.triggers.StepPerSecondLogTrigger(
        train_step: tf.Variable, interval: int, log_to_terminal: bool = True
    )

### Used in the notebooks

| Used in the tutorials |
|---|
| - [SAC minitaur with the Actor-Learner API](https://www.tensorflow.org/agents/tutorials/7_SAC_minitaur_tutorial) |

<br />

<br />

<br />

| ## Args ||
|---|---|
| `train_step` | [`tf.Variable`](https://www.tensorflow.org/api_docs/python/tf/Variable) which keeps track of the number of train steps. |
| `interval` | How often, in train_steps, the trigger will save. Note that as long as the \>= `interval` number of steps have passed since the last trigger, the event gets triggered. The current value is not necessarily `interval` steps away from the last triggered value. |
| `log_to_terminal` | If True ouputs steps/sec to logging.info. |

<br />

## Methods

### `reset`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/train/interval_trigger.py#L67-L69)

    reset() -> None

Resets the trigger interval.

### `set_start`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/train/interval_trigger.py#L71-L72)

    set_start(
        start: int
    ) -> None

### `__call__`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/train/interval_trigger.py#L50-L65)

    __call__(
        value: int, force_trigger: bool = False
    ) -> None

Maybe trigger the event based on the interval.

<br />

<br />

<br />

| Args ||
|---|---|
| `value` | the value for triggering. |
| `force_trigger` | If True, the trigger will be forced triggered unless the last trigger value is equal to `value`. |

<br />