| layer_unit_normalization {keras} | R Documentation |
Unit normalization layer
Description
Unit normalization layer
Usage
layer_unit_normalization(object, axis = -1L, ...)
Arguments
object |
What to compose the new
|
axis |
Integer or list. The axis or axes to normalize across. Typically
this is the features axis or axes. The left-out axes are typically the
batch axis or axes. Defaults to |
... |
standard layer arguments. data <- as_tensor(1:6, shape = c(2, 3), dtype = "float32")
normalized_data <- data %>% layer_unit_normalization()
for(row in 1:2)
normalized_data[row, ] %>%
{ sum(.^2) } %>%
print()
# tf.Tensor(0.9999999, shape=(), dtype=float32)
# tf.Tensor(1.0, shape=(), dtype=float32)
|
Details
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).
See Also
[Package keras version 2.15.0 Index]