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

Class Model

python/tests/test_optimizers.py:535–541  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

533
534 def test_init_from_state(self):
535 class Model(nn.Module):
536 def __init__(self):
537 super().__init__()
538 self.l1 = nn.Linear(2, 2)
539 self.drop = nn.Dropout(p=0.5)
540 self.l2 = nn.Linear(2, 2)
541 self.vals = [nn.Linear(2, 2), nn.ReLU(), nn.ReLU()]
542
543 model = Model()
544 optimizer = opt.Adam(learning_rate=3e-4)

Callers 2

test_init_from_stateMethod · 0.70
test_multi_optimizerMethod · 0.70

Calls

no outgoing calls

Tested by 2

test_init_from_stateMethod · 0.56
test_multi_optimizerMethod · 0.56