code: def test_from_params(self):
      optim = self._get_optimizer()
      sched = LearningRateScheduler.from_params(
          optimizer=optim,
          params=Params(
              {
                  "type": "slanted_triangular",
                  "num_epochs": 5,
                  "num_steps_per_epoch": 10,
                  "gradual_unfreezing": True,
                  "discriminative_fine_tuning": True,
                  "decay_factor": 0.5,
              }
          ),
      )
  
      assert sched.num_epochs == 5
      assert sched.num_steps_per_epoch == 10
      assert sched.gradual_unfreezing is True
      assert sched.freezing_current is True
  
      assert len(optim.param_groups) == 3
      # The default parameter group in the Optimizer is empty
      assert not optim.param_groups[-1]["params"]
      assert optim.param_groups[-2]["lr"] == 1.0 / sched.ratio
      assert optim.param_groups[-3]["lr"] == 0.5 / sched.ratio
  
      with pytest.raises(ConfigurationError):
          # num_epochs and num_steps_per_epoch are required
          LearningRateScheduler.from_params(
              optimizer=optim,
              params=Params(
                  {"type": "slanted_triangular", "num_epochs": 5}
              ),
          )
          LearningRateScheduler.from_params(
              optimizer=optim,
              params=Params(
                  {"type": "slanted_triangular", "num_steps_epochs": 10}
              ),
          )
  
imports: from collections import OrderedDict
  from copy import deepcopy
  from typing import Any, Dict, List, Tuple
  import torch
  import pytest
  from allennlp.common import Lazy, Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.data_loaders import SimpleDataLoader
  from allennlp.training import Trainer
  from allennlp.training.learning_rate_schedulers import LearningRateScheduler, SlantedTriangular
  from allennlp.training.optimizers import Optimizer
label_desc: Use image node_id 6 for calling the SlantedTriangularTest obj's underlying member method code with example usage: obj.test_from_params() without return types