function train(data, model, batch_size, num_epochs):
   for epoch in range(num_epochs): # one pass through all the data

      for batch in split_into_batches(data, batch_size):
        loss = compute_loss(model, batch)
        gradients = compute_gradients(loss)
        model.update(gradients) # one update per batch, not per e
 xample
