% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/nn-kaf-layer.R
\name{nn_kaf_layer}
\alias{nn_kaf_layer}
\title{Kolmogorov-Arnold Fourier Layer}
\usage{
nn_kaf_layer(
  input_dim,
  output_dim,
  num_grids = 8,
  dropout = 0,
  use_layernorm = TRUE,
  activation_expectation = 1.64,
  fourier_init_scale = 0.01
)
}
\arguments{
\item{input_dim}{Integer. Input dimension.}

\item{output_dim}{Integer. Output dimension.}

\item{num_grids}{Integer. Number of Fourier frequencies.}

\item{dropout}{Numeric. Dropout probability.}

\item{use_layernorm}{Logical. Whether to apply layer normalization before
the Fourier feature block.}

\item{activation_expectation}{Numeric. Scaling constant for Fourier
initialization.}

\item{fourier_init_scale}{Numeric. Initial scale of the Fourier component.}
}
\value{
A torch nn_module.
}
\description{
Torch module implementing one KAF layer using a hybrid GELU and
trainable Random Fourier Features activation.
}
\details{
The layer computes a feature-wise hybrid activation of the form:

\deqn{
z = \alpha \odot GELU(x) + \beta \odot RFF(x)
}

followed by a linear projection to the output dimension.
}
