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

Method __init__

normalizing_flow/flows.py:12–18  ·  view source on GitHub ↗
(self, n_layers: int, d_in: int, d_hidden: int, d_out: int)

Source from the content-addressed store, hash-verified

10
11class MLP(nn.Module):
12 def __init__(self, n_layers: int, d_in: int, d_hidden: int, d_out: int):
13 super().__init__()
14 layer_sizes = [d_in] + [d_hidden] * n_layers + [d_out]
15 self.layers = [
16 nn.Linear(idim, odim)
17 for idim, odim in zip(layer_sizes[:-1], layer_sizes[1:])
18 ]
19
20 def __call__(self, x):
21 for l in self.layers[:-1]:

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected