layerNorm

abstract fun layerNorm(normalizedShape: IntArray, eps: Double = 1.0E-5, elementwiseAffine: Boolean = true, id: String = "")(source)

Creates a layer normalization layer - used in attention mechanisms. Normalizes the input across the last dimension(s).

Parameters

normalizedShape

The shape of the normalization (typically the last dimension(s))

eps

Small value added to the denominator for numerical stability

elementwiseAffine

Whether to learn elementwise affine parameters (gamma and beta)

id

Optional identifier for the layer