          if decay_epoch and epoch > decay_epoch:
              trainer.set_learning_rate(trainer.learning_rate * 0.1)
          for batch_i, (features, label) in enumerate(data_iter):
              with autograd.record():
                  output = net(features)
                  loss = square_loss(output, label)
              loss.backward()
              trainer.step(batch_size)
              if batch_i * batch_size % log_interval == 0:
                  y_vals.append(square_loss(net(X), y).mean().asnumpy())
      print('w:', net[0].weight.data(), '\nb:', net[0].bias.data(), '\n')
      x_vals = np.linspace(0, num_epochs, len(y_vals), endpoint=True)
 
</s> remove                 y_vals.append(square_loss(net(X), y).mean().asnumpy())
 </s> add                 ls.append(loss(net(features), labels).mean().asnumpy())
    # To print more conveniently, use numpy. </s> remove     return nd.mean(output.argmax(axis=1)==label).asscalar()

 </s> add     """Get accuracy."""
    return (output.argmax(axis=1) == label).mean().asscalar() </s> remove     n = 0.
    if isinstance(data_iterator, mx.io.MXDataIter):
        data_iterator.reset()
    for batch in data_iterator:
        data, label, batch_size = _get_batch(batch, ctx)
        for X, y in zip(data, label):
 </s> add     n = 0
    if isinstance(data_iter, mx.io.MXDataIter):
        data_iter.reset()
    for batch in data_iter:
        features, labels, batch_size = _get_batch(batch, ctx)
        for X, y in zip(features, labels):
                l = loss(net(X), y)
            l.backward()
          if decay_epoch and epoch > decay_epoch:
              trainer.set_learning_rate(trainer.learning_rate * 0.1)
          for batch_i, (features, label) in enumerate(data_iter):
              with autograd.record():
                l = loss(net(X), y)
            l.backward()
                l = loss(net(X), y)
            l.backward()
                l = loss(net(X), y)
            l.backward()
              trainer.step(batch_size)
              if batch_i * batch_size % log_interval == 0:
                  y_vals.append(square_loss(net(X), y).mean().asnumpy())
      print('w:', net[0].weight.data(), '\nb:', net[0].bias.data(), '\n')
      x_vals = np.linspace(0, num_epochs, len(y_vals), endpoint=True)
keep keep keep keep replace replace replace keep keep keep keep keep
 apply gluonbook in dl basics, cnn, remove gluonbook deps 
gluonbook/utils.py