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 b9cd7e8f.

Read the Docs v: stable
Versions
latest
stable
v0.3.0
v0.2.2
v0.2.1
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.