class_docstr: Generic homotopy class.
  
  This class is designed to be used in `optimize_acqf_homotopy`. Given a set of
  homotopy parameters and corresponding schedules we step through the homotopies
  until we have solved the final problem. We additionally support passing in a list
  of callbacks that will be executed each time `step`, `reset`, and `restart` are
  called.
docstr: Initialize the homotopy.
  
  Args:
      homotopy_parameters: List of homotopy parameters
      callbacks: Optional list of callbacks that are executed each time
          `restart`, `reset`, or `step` are called. These may be used to, e.g.,
          reinitialize the acquisition function which is needed when using qNEHVI.
docstr_tok: ["Initialize","the","homotopy",".","Args",":","homotopy_parameters",":","List","of","homotopy","parameters","callbacks",":","Optional","list","of","callbacks","that","are","executed","each","time","`","restart","`",",","`","reset","`",",","or","`","step","`","are","called",".","These","may","be","used","to",",","e.g.",",","reinitialize","the","acquisition","function","which","is","needed","when","using","qNEHVI","."]
code: def __init__(
      self,
      homotopy_parameters: List[HomotopyParameter],
      callbacks: Optional[List[Callable]] = None,
  ) -> None:
      r"""Initialize the homotopy.
  
      Args:
          homotopy_parameters: List of homotopy parameters
          callbacks: Optional list of callbacks that are executed each time
              `restart`, `reset`, or `step` are called. These may be used to, e.g.,
              reinitialize the acquisition function which is needed when using qNEHVI.
      """
      self._homotopy_parameters = homotopy_parameters
      self._callbacks = callbacks or []
      self._original_values = [
          hp.parameter.item() for hp in self._homotopy_parameters
      ]
      assert all(
          isinstance(hp.parameter, Parameter)
          or isinstance(hp.parameter, Tensor)
          for hp in self._homotopy_parameters
      )
      # Assume the same number of steps for now
      assert (
          len({h.schedule.num_steps for h in self._homotopy_parameters})
          == 1
      )
      # Initialize the homotopy parameters
      self.restart()
  
imports: from __future__ import annotations
  import math
  from abc import ABC, abstractmethod
  from dataclasses import dataclass
  from typing import Any, Callable, List, Optional, Union
  import torch
  from torch import Tensor
  from torch.nn import Parameter
label_desc: Use image node_id 1 to create a new Homotopy object  with example: obj = Homotopy(homotopy_parameters, callbacks)