class_docstr: Tests for early stopping logic.
class_docstr_tok: ["Tests","for","early","stopping","logic","."]
docstr: Test early stopping.
docstr_tok: ["Test","early","stopping","."]
code: def test_early_stopping(self):
      """Test early stopping."""
      for epoch, value in enumerate([10.0, 9.0, 8.0, 7.99, 7.98, 7.97]):
          stop = self.instance.report_result(metric=value, epoch=epoch)
          self.assertEqual(stop, epoch >= 4)
  
imports: import unittest
  from typing import List
  import numpy
  import pytest
  import torch
  import unittest_templates
  from torch.optim import Adam
  from pykeen.datasets import Nations
  from pykeen.evaluation import RankBasedEvaluator
  from pykeen.models import Model, TransE
  from pykeen.stoppers.early_stopping import EarlyStopper, EarlyStoppingLogic, is_improvement
  from pykeen.training import SLCWATrainingLoop
  from tests import cases
label_desc: Use image node_id 2 for calling the TestEarlyStoppingLogic obj's underlying member method code with example usage: obj.test_early_stopping() without return types