                  y = Y.T.reshape((-1,))
                  l = loss(output, y).mean()
              l.backward()
              params = [p.data() for p in model.collect_params().values()]
              grad_clipping(params, clipping_theta, ctx)
              trainer.step(1)
              l_sum += l.asscalar()
  
          if (epoch + 1) % pred_period == 0:
              print('epoch %d, perplexity %f, time %.2f sec' % (
 
</s> remove             l_sum += l.asscalar()
 </s> add             l_sum += l.asscalar() * y.size
            n += y.size </s> remove             sgd(params, lr, 1)
            l_sum += l.asscalar()
 </s> add             gb.sgd(params, lr, 1)
            l_sum += l.asscalar() * y.size
            n += y.size </s> remove                 epoch + 1, math.exp(l_sum / (t + 1)), time.time() - start))
 </s> add                 epoch + 1, math.exp(l_sum / n), time.time() - start)) </s> remove                 epoch + 1, math.exp(l_sum / (t + 1)), time.time() - start))
 </s> add                 epoch + 1, math.exp(l_sum / n), time.time() - start)) </s> remove                     prefix, pred_len, model, vocab_size,
                    ctx, idx_to_char, char_to_idx))
 </s> add                     prefix, pred_len, model, vocab_size, ctx, idx_to_char,
                    char_to_idx))
            gb.grad_clipping(params, clipping_theta, ctx)
                  y = Y.T.reshape((-1,))
                  l = loss(output, y).mean()
              l.backward()
              params = [p.data() for p in model.collect_params().values()]
            gb.grad_clipping(params, clipping_theta, ctx)
              trainer.step(1)
              l_sum += l.asscalar()
  
          if (epoch + 1) % pred_period == 0:
              print('epoch %d, perplexity %f, time %.2f sec' % (
keep keep keep keep replace keep keep keep keep keep
 gb 0.8.9, fix acc, loss computations 
gluonbook/utils.py