WLJS LogoWLJS Notebook

UnitVectorLayer

UnitVectorLayer[n] represents a net layer that transforms integers between 1 and n into n-dimensional unit vectors.

UnitVectorLayer[] leaves the n to be inferred from context.

Examples

Create a unit vector layer:

UnitVectorLayer[5]

Apply to an input:

UnitVectorLayer[5][3]
(* {0., 0., 1., 0., 0.} *)

Please visit the official Wolfram Language Reference for more details.

On this page