DriftTexture · function

softmax

Each row of x to a distribution, stably: the row's largest value is subtracted before the exponential, so logits near a thousand give their logistic rather than Infinity / Infinity.

Explained in DriftTexture.

function softmax(x: Float32Array, rows: number, cols: number, out: Float32Array): void
import { softmax } from '@driftengine/texture';

Parameters

ParameterTypeDescription
xFloat32Array
rowsnumber
colsnumber
outFloat32Array