code: def should_stop_early(self) -> bool:
          
          if self._patience is None:
              return False
          else:
              return self._epochs_with_no_improvement >= self._patience
docs: Returns true if improvement has stopped for long enough.