Reference
OneHot.OneHotArray
— TypeOneHotArray
A type to hold a one-hot encoded array efficiently. Implements efficient matrix multiplication.
OneHot.argmax_
— Methodargmax_(A; dims)
Index of maximum elements of A
over given dims
, dropping the reduced dims
.
OneHot.decode
— Methoddecode(X)
Returns an array A
such that OneHot.encode(A, 1:q) == X
. Here q = size(X, 1)
is interpreted as the number of classes.
OneHot.encode
— Functionencode(data, labels)
Returns a one-hot encoded version of data
, where classes are indexed according to labels
.
OneHot.tensormul
— Methodtensormul(A, B, dims)
A*B
contracting first dims
dimensions of A
with first dims
dimensions of B
(which must match). Exploits the fact that some of the tensors are OneHotArray
.