code: def setup_method(self):
      super().setup_method()
      self.model = torch.nn.Sequential(torch.nn.Linear(10, 10))
  
      # We use these cases to verify that the scheduler works as expected.
      # Each case consists of 5 parameters:
      # - epochs: the total # of epochs to run for.
      # - params: parameters passed to initialize the scheduler.
      # - learning rate checks: a list of tuples, each of which specifies an epoch
      #   number and the expected value of the learning rate at that epoch.
      # - checkpoints: a list of epoch numbers at which to save the scheduler
      #   state, and then restore from the saved state and resume.
      self.cosine_schedule_cases = [
          (
              30,
              {"t_initial": 30, "t_mul": 1.0},
              [
                  (0, 1.0),
                  (15, 0.5000000000000001),
                  (29, 0.0027390523158632996),
              ],
              [10, 14],
          ),
          (
              10,
              {"t_initial": 1, "t_mul": 2.0},
              [(0, 1.0), (1, 1.0), (2, 0.5), (3, 1.0)],
              [1, 3],
          ),
          (
              30,
              {"t_initial": 1, "t_mul": 1.0},
              [(0, 1.0), (15, 1.0), (29, 1.0)],
              [],
          ),
          (
              60,
              {"t_initial": 30, "t_mul": 1.0},
              [
                  (0, 1.0),
                  (15, 0.5000000000000001),
                  (29, 0.0027390523158632996),
                  (30, 1.0),
                  (45, 0.5000000000000001),
                  (59, 0.0027390523158632996),
              ],
              [30, 35],
          ),
          (
              60,
              {"t_initial": 30, "t_mul": 1.0, "eta_mul": 0.5},
              [
                  (0, 1.0),
                  (15, 0.5000000000000001),
                  (29, 0.0027390523158632996),
                  (30, 0.5),
              ],
              [],
          ),
          (
              100,
              {"t_initial": 30, "t_mul": 1.5},
              [
                  (0, 1.0),
                  (29, 0.0027390523158632996),
                  (30, 1.0),
                  (74, 0.0012179748700879012),
              ],
              [],
          ),
          (
              210,
              {"t_initial": 30, "t_mul": 2},
              [
                  (0, 1.0),
                  (29, 0.0027390523158632996),
                  (30, 1.0),
                  (89, 0.0006852326227130834),
                  (90, 1.0),
                  (209, 0.00017133751222137006),
              ],
              [],
          ),
          (
              210,
              {"t_initial": 30, "t_mul": 2, "eta_mul": 0.5},
              [(0, 1.0), (30, 0.5), (90, 0.25)],
              [29, 90],
          ),
          (
              150,
              {"t_initial": 30, "t_mul": 1},
              [
                  (0, 1.0),
                  (29, 0.0027390523158632996),
                  (30, 1.0),
                  (59, 0.0027390523158632996),
                  (60, 1.0),
                  (89, 0.0027390523158632996),
                  (90, 1.0),
              ],
              [],
          ),
          (
              10,
              {"t_initial": 1, "t_mul": 1, "eta_mul": 0.5},
              [(0, 1.0), (1, 0.5), (2, 0.25)],
              [],
          ),
      ]
  
file_path: allennlp/tests/training/learning_rate_schedulers/cosine_test.py
imports: from copy import deepcopy
  from typing import Dict, Any
  import torch
  import pytest
  from allennlp.common import Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.training.learning_rate_schedulers import LearningRateScheduler
  from allennlp.training.optimizers import Optimizer
label_desc: Use image node_id 1 for calling the CosineWithRestartsTest obj's underlying member method code with example usage: obj.setup_method() without return types