# tf.keras.layers.experimental.preprocessing.Normalization

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/layers/preprocessing/normalization.py#L42-L128) |

Feature-wise normalization of the data.

    tf.keras.layers.experimental.preprocessing.Normalization(
        axis=-1, dtype=None, **kwargs
    )

This layer will coerce its inputs into a normal distribution centered around
0 with standard deviation 1. It accomplishes this by precomputing the mean and
variance of the data, and calling (input-mean)/sqrt(var) at runtime.

What happens in `adapt`: Compute mean and variance of the data and store them
as the layer's weights. `adapt` should be called before `fit`, `evaluate`,
or `predict`.

<br />

<br />

<br />

| ## Attributes ||
|---|---|
| `axis` | Integer or tuple of integers, the axis or axes that should be normalized (typically the features axis). We will normalize each element in the specified axis. The default is '-1' (the innermost axis); 0 (the batch axis) is not allowed. |

<br />

## Methods

### `adapt`

[View source](https://github.com/tensorflow/tensorflow/blob/v2.2.0/tensorflow/python/keras/engine/base_preprocessing_layer.py#L129-L197)

    adapt(
        data, reset_state=True
    )

Fits the state of the preprocessing layer to the data being passed.

<br />

<br />

<br />

| Arguments ||
|---|---|
| `data` | The data to train on. It can be passed either as a tf.data Dataset, or as a numpy array. |
| `reset_state` | Optional argument specifying whether to clear the state of the layer at the start of the call to `adapt`, or whether to start from the existing state. Subclasses may choose to throw if reset_state is set to 'False'. |

<br />