contrib.keras.backend.one_hot

tf.contrib.keras.backend.one_hot

tf.contrib.keras.backend.one_hot

one_hot(
    indices,
    num_classes
)

Defined in tensorflow/contrib/keras/python/keras/backend.py.

Computes the one-hot representation of an integer tensor.

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.

© 2017 The TensorFlow Authors. All rights reserved.
Licensed under the Creative Commons Attribution License 3.0.
Code samples licensed under the Apache 2.0 License.
https://www.tensorflow.org/api_docs/python/tf/contrib/keras/backend/one_hot

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部