tf.keras.backend.one_hot
Computes the one-hot representation of an integer tensor.
tf.keras.backend.one_hot(
indices, num_classes
)
Arguments |
indices
|
nD integer tensor of shape
(batch_size, dim1, dim2, ... dim(n-1))
|
num_classes
|
Integer, number of classes to consider.
|
Returns |
(n + 1)D one hot representation of the input
with shape (batch_size, dim1, dim2, ... dim(n-1), num_classes)
|
Returns |
The one-hot tensor.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2020-10-01 UTC.
[null,null,["Last updated 2020-10-01 UTC."],[],[]]