mlx.nn.GLU

目录

mlx.nn.GLU#

class GLU(axis: int = -1)#

应用门控线性单元函数。

此函数将输入的 axis 维度分割成两半(\(a\)\(b\)),并应用 \(a * \sigma(b)\)

\[\textrm{GLU}(x) = a * \sigma(b)\]
参数:

axis (int) – 要分割的维度。默认值:-1

方法