DriftTexture · function
layerNorm
Each row normalised to zero mean and unit variance, then scaled by gamma and shifted by beta.
Explained in DriftTexture.
function layerNorm(x: Float32Array, rows: number, cols: number, gamma: Float32Array, beta: Float32Array, epsilon: number, out: Float32Array): voidimport { layerNorm } from '@driftengine/texture';Parameters
| Parameter | Type | Description |
|---|---|---|
x | Float32Array | |
rows | number | |
cols | number | |
gamma | Float32Array | |
beta | Float32Array | |
epsilon | number | |
out | Float32Array |
In depth
The population variance, divided by the row's length and not one less, which is what the upstream frameworks compute and therefore what their trained weights expect.