MCPcopy Create free account
hub / github.com/ml-explore/mlx-examples / __init__

Method __init__

lora/models.py:193–197  ·  view source on GitHub ↗
(self, dim, hidden_dim)

Source from the content-addressed store, hash-verified

191
192class MLP(nn.Module):
193 def __init__(self, dim, hidden_dim):
194 super().__init__()
195 self.gate_proj = nn.Linear(dim, hidden_dim, bias=False)
196 self.down_proj = nn.Linear(hidden_dim, dim, bias=False)
197 self.up_proj = nn.Linear(dim, hidden_dim, bias=False)
198
199 def __call__(self, x) -> mx.array:
200 return self.down_proj(nn.silu(self.gate_proj(x)) * self.up_proj(x))

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected