View source on GitHub
|
Unit normalization layer.
Inherits From: Layer, Operation
tf.keras.layers.UnitNormalization(
axis=-1, **kwargs
)
Normalize a batch of inputs so that each input in the batch has a L2 norm
equal to 1 (across the axes specified in axis).
Example:
data = np.arange(6).reshape(2, 3)normalized_data = keras.layers.UnitNormalization()(data)np.sum(normalized_data[0, :] ** 2)1.0
Methods
from_config
@classmethodfrom_config( config )
Creates an operation from its config.
This method is the reverse of get_config, capable of instantiating the
same operation from the config dictionary.
if "dtype" in config and isinstance(config["dtype"], dict):
policy = dtype_policies.deserialize(config["dtype"])
| Args | |
|---|---|
config
|
A Python dictionary, typically the output of get_config.
|
| Returns | |
|---|---|
| An operation instance. |
View source on GitHub