if X_val is not None and y_val is not None: val_loss = self.validate(X_val, y_val) self.val_losses.append(val_loss)