epoch_loss = 0.0
for i in range(0, len(x_train), batch_size):
// Get batch tensors
r = min(n, i+batch_size)
x_b, len_b = self._make_tensor(x_train[i:r])
y_b = y_train[i:r]
// Run training step and evaluate loss function
epoch_loss += self.session.run([self.loss, self.train_fn], {
After Change
// Print training stats
if verbose and (t % print_freq == 0 or t in [0, (n_epochs-1)]):
print("[{0}] Epoch {1} ({2:.2f}s)\tAverage loss={3:.6f}".format(
self.name, t, time() - st, np.mean(epoch_loss)
))
if verbose:
print("[{0}] Training done ({1:.2f}s)".format(self.name, time()-st))