| ggml_layer_layer_norm | R Documentation |
Normalizes each sample over its own features – subtract the mean, divide by
the standard deviation – then scales by gamma and shifts by beta (both
learnable). Like ggml_layer_rms_norm it keeps no running
statistics and does not couple the samples in a batch, but unlike it, it does
centre the input. This is the normalization of the original transformer.
ggml_layer_layer_norm(model, eps = 1e-05, name = NULL, trainable = TRUE)
model |
A |
eps |
Small constant for numerical stability (default 1e-5) |
name |
Optional character name for the layer. |
trainable |
Logical; whether the layer weights are updated during training. |
The model with the layer appended, or a new ggml_tensor_node
in the functional API.
ggml_layer_rms_norm, ggml_layer_batch_norm
x <- ggml_input(shape = c(10L, 32L))
h <- x |> ggml_layer_layer_norm()
h <- h |> ggml_layer_attention(d_model = 32L, n_heads = 4L)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.