kempnerforge.model.mlp¶
Feed-forward network implementations for KempnerForge models.
Functions
|
Build an MLP by activation name. |
Classes
Standard two-layer MLP with configurable activation. |
|
SwiGLU feed-forward network (Llama-style). |
- class kempnerforge.model.mlp.SwiGLUMLP[source]¶
Bases:
ModuleSwiGLU feed-forward network (Llama-style).
Architecture: gate_proj + up_proj → SiLU(gate) * up → down_proj Uses 3 weight matrices instead of 2, with SiLU gating.
- forward(x)[source]¶
- Parameters:
x (torch.Tensor)
- Return type: