 @@ -186,14 +190,19 @@ def train(train_ds, test_ds):
    rng, init_rng = random.split(rng)
    model = create_model(init_rng)
-   optimizer = create_optimizer(model, FLAGS.learning_rate, FLAGS.momentum)
+   optimizer = create_optimizer(model, learning_rate, momentum)
 +  params_ema = model.params
  
    for epoch in range(1, num_epochs + 1):

diff --git a/examples/mnist/train.py b/examples/mnist/train.py
index 9c21985..4306d09 100644
--- a/examples/mnist/train.py
+++ b/examples/mnist/train.py
@@ -110,7 +110,7 @@ def compute_metrics(logits, labels):
 
 

     summary_writer.scalar('train_loss', train_metrics['loss'], epoch)
     summary_writer.scalar('train_accuracy', train_metrics['accuracy'], epoch)
     summary_writer.scalar('eval_loss', loss, epoch)

