# tf_agents.utils.tensor_normalizer.StreamingTensorNormalizer

<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/utils/tensor_normalizer.py#L288-L394) |

Normalizes mean \& variance based on full history of tensor values.

Inherits From: [`TensorNormalizer`](https://www.tensorflow.org/agents/api_docs/python/tf_agents/utils/tensor_normalizer/TensorNormalizer)

    tf_agents.utils.tensor_normalizer.StreamingTensorNormalizer(
        tensor_spec, scope='normalize_tensor'
    )

<br />

<br />

<br />

| ## Args ||
|---|---|
| `tensor_spec` | The specs of the tensors to normalize. |
| `scope` | Scope for the [`tf.Module`](https://www.tensorflow.org/api_docs/python/tf/Module). |

<br />

## Methods

### `map_dtype`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/tensor_normalizer.py#L89-L91)

    map_dtype(
        dtype
    )

### `normalize`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/tensor_normalizer.py#L134-L205)

    normalize(
        tensor, clip_value=5.0, center_mean=True, variance_epsilon=0.001
    )

Applies normalization to tensor.

<br />

<br />

<br />

| Args ||
|---|---|
| `tensor` | Tensor to normalize. |
| `clip_value` | Clips normalized observations between +/- this value if clip_value \> 0, otherwise does not apply clipping. |
| `center_mean` | If true, subtracts off mean from normalized tensor. |
| `variance_epsilon` | Epsilon to avoid division by zero in normalization. |

<br />

<br />

<br />

<br />

| Returns ||
|---|---|
| `normalized_tensor` | Tensor after applying normalization. |

<br />

### `reset`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/tensor_normalizer.py#L383-L394)

    reset()

Reset the count, mean and variance to its initial state.

### `update`

[View source](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/utils/tensor_normalizer.py#L119-L132)

    update(
        tensor, outer_dims=(0,)
    )

Updates tensor normalizer variables.