Shortcuts

rising.ops

Provides Operators working on single tensors.

On Tensors

torch_one_hot

rising.ops.tensor.torch_one_hot(target, num_classes=None)[source][source]

Compute one hot encoding of input tensor

Parameters
  • target (Tensor) – tensor to be converted

  • num_classes (Optional[int]) – number of classes. If num_classes is None, the maximum of target is used

Returns

one hot encoded tensor

Return type

torch.Tensor

np_one_hot

rising.ops.tensor.np_one_hot(target, num_classes=None)[source][source]

Compute one hot encoding of input array

Parameters
  • target (ndarray) – array to be converted

  • num_classes (Optional[int]) – number of classes

Returns

one hot encoded array

Return type

numpy.ndarray


© Copyright Copyright (c) 2019-2020, Justus Schock, Michael Baumgartner.. Revision 2a580e9c.

Read the Docs v: latest
Versions
latest
stable
v0.2.0post0
v0.2.0
Downloads
pdf
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.