batch_loss = np.mean(losses) epoch_losses.append(batch_loss)