class_docstr: Tests for early stopping during training.
class_docstr_tok: ["Tests","for","early","stopping","during","training","."]
docstr: Prepare for testing the early stopper.
docstr_tok: ["Prepare","for","testing","the","early","stopper","."]
code: def setUp(self):
      """Prepare for testing the early stopper."""
      # Set automatic_memory_optimization to false for tests
      self.mock_evaluator = MockEvaluator(
          key=None,
          values=self.mock_losses,
          automatic_memory_optimization=False,
      )
      self.triples_factory = Nations()
      self.model = FixedModel(
          triples_factory=self.triples_factory.training
      )
      self.stopper = EarlyStopper(
          metric=None,
          model=self.model,
          evaluator=self.mock_evaluator,
          training_triples_factory=self.triples_factory.training,
          evaluation_triples_factory=self.triples_factory.validation,
          patience=self.patience,
          relative_delta=self.delta,
          larger_is_better=False,
          frequency=1,
      )
  
file_path: pykeen/tests/test_training/test_stopping.py
imports: import unittest
  from typing import List, Optional
  import torch
  from torch import optim
  from pykeen.datasets import Nations
  from pykeen.models import FixedModel, Model
  from pykeen.stoppers.early_stopping import EarlyStopper
  from pykeen.training import SLCWATrainingLoop
  from pykeen.triples import TriplesFactory
  from pykeen.typing import MappedTriples
  from tests.mocks import MockEvaluator
label_desc: Use image node_id 1 for calling the TestTrainingEarlyStopping obj's underlying member method code with example usage: obj.setUp() without return types