def one_hot

mlbend-preprocess@0.1.0.0 · main.bend:272

import mlbend-preprocess@0.1.0.0/main.bend as MlbendPreprocess
import Base
import bend-ml-tensor@0.1.0.0/main.bend as T

272# The one-hot encoding: a row of k numbers for every label, with a one
273# in the column of the label. It is Nothing when there are not exactly
274# n labels.
275def one_hot(+k: Nat, +n: Nat, labels: List<&2, Nat>) -> Maybe<&2, T.Mat<n, k>>:
276  T.Mat.of(n, k, one_hot_rows(labels, k))

Uses (6)

Used by (0)

No other definition uses this definition.