SwiGLU#
- class sdm.nn.SwiGLU(channels: int, hidden_channels: int, bias: bool = True, device: device | str | None = None, dtype: dtype | None = None)#
Bases:
Module\(\mathrm{FFN}_{\mathrm{SwiGLU}}\) block from the “GLU Variants Improve Transformer” paper.
\[W_{\mathrm{down}}( \operatorname{Swish}_1(W_{\mathrm{gate}} x + b_{\mathrm{gate}}) \otimes (W_{\mathrm{up}} x + b_{\mathrm{up}}) ) + b_{\mathrm{down}}\]- Parameters: