tf.contrib.layers.one_hot_encoding(*args, **kwargs)
See the guide: Layers (contrib) > Higher level ops for building neural network layers
Transform numeric labels into onehot_labels using tf.one_hot
.
labels
: [batch_size] target labels.num_classes
: total number of classes.on_value
: A scalar defining the on-value.off_value
: A scalar defining the off-value.outputs_collections
: collection to add the outputs.scope
: Optional scope for name_scope.one hot encoding of the labels.
Defined in tensorflow/contrib/framework/python/ops/arg_scope.py
.
© 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/layers/one_hot_encoding