MCPcopy Create free account
hub / github.com/Kaggle/docker-python / create_train_state

Method create_train_state

tests/test_flax.py:37–42  ·  view source on GitHub ↗
(rng, learning_rate, momentum)

Source from the content-addressed store, hash-verified

35 return x
36
37 def create_train_state(rng, learning_rate, momentum):
38 cnn = CNN()
39 params = cnn.init(rng, jnp.ones([1, 224, 224, 3]))['params']
40 tx = optax.sgd(learning_rate, momentum)
41 return train_state.TrainState.create(
42 apply_fn=cnn.apply, params=params, tx=tx)
43
44 rng = jax.random.PRNGKey(0)
45 rng, init_rng = jax.random.split(rng)

Callers

nothing calls this directly

Calls 1

CNNClass · 0.85

Tested by

no test coverage detected