MCPcopy Create free account
hub / github.com/ckd0817/LLM-Interview-Code / SwiGLUFFN

Class SwiGLUFFN

ffn/SwiGLUFFN.py:15–71  ·  view source on GitHub ↗

SwiGLU 前馈神经网络模块 结构: output = Down(Gate(x) * Up(x)) 其中 Gate 使用 SiLU (Swish) 激活函数,实现门控机制。 相比传统 FFN 的 ReLU 激活,SwiGLU 的门控机制可以更好地捕捉复杂的非线性关系。 Args: model_dim: 输入/输出维度 intermediate_dim: 中间层维度(通常是 model_dim 的 8/3 倍)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected