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)print(np.sum(normalized_data[0, :] ** 2)1.0
Methods
from_config
@classmethodfrom_config( config )
Creates a layer from its config.
This method is the reverse of get_config,
capable of instantiating the same layer from the config
dictionary. It does not handle layer connectivity
(handled by Network), nor weights (handled by set_weights).
| Args | |
|---|---|
config
|
A Python dictionary, typically the output of get_config. |
| Returns | |
|---|---|
| A layer instance. |
symbolic_call
symbolic_call(
*args, **kwargs
)
View source on GitHub