class_docstr: Adapts tunable parameters, namely step size and mass matrix, during the
  warmup phase. This class provides lookup properties to read the latest
  values of ``step_size`` and ``inverse_mass_matrix``. These values are
  periodically updated when adaptation is engaged.
class_docstr_tok: ["Adapts","tunable","parameters",",","namely","step","size","and","mass","matrix",",","during","the","warmup","phase",".","This","class","provides","lookup","properties","to","read","the","latest","values","of","``","step_size","``","and","``","inverse_mass_matrix","``",".","These","values","are","periodically","updated","when","adaptation","is","engaged","."]
code: def _build_adaptation_schedule(self):
      adaptation_schedule = []
      # from Stan, for small warmup_steps < 20
      if self._warmup_steps < 20:
          adaptation_schedule.append(
              adapt_window(0, self._warmup_steps - 1)
          )
          return adaptation_schedule
  
      start_buffer_size = self._adapt_start_buffer
      end_buffer_size = self._adapt_end_buffer
      init_window_size = self._adapt_initial_window
      if (
          self._adapt_start_buffer
          + self._adapt_end_buffer
          + self._adapt_initial_window
          > self._warmup_steps
      ):
          start_buffer_size = int(0.15 * self._warmup_steps)
          end_buffer_size = int(0.1 * self._warmup_steps)
          init_window_size = (
              self._warmup_steps - start_buffer_size - end_buffer_size
          )
      adaptation_schedule.append(
          adapt_window(start=0, end=start_buffer_size - 1)
      )
      end_window_start = self._warmup_steps - end_buffer_size
  
      next_window_size = init_window_size
      next_window_start = start_buffer_size
      while next_window_start < end_window_start:
          cur_window_start, cur_window_size = (
              next_window_start,
              next_window_size,
          )
          # Ensure that slow adaptation windows are monotonically increasing
          if 3 * cur_window_size <= end_window_start - cur_window_start:
              next_window_size = 2 * cur_window_size
          else:
              cur_window_size = end_window_start - cur_window_start
          next_window_start = cur_window_start + cur_window_size
          adaptation_schedule.append(
              adapt_window(cur_window_start, next_window_start - 1)
          )
      adaptation_schedule.append(
          adapt_window(end_window_start, self._warmup_steps - 1)
      )
      return adaptation_schedule
  
imports: import math
  from collections import namedtuple
  import torch
  import pyro
  from pyro.ops.arrowhead import SymmArrowhead, sqrt, triu_gram, triu_inverse, triu_matvecmul
  from pyro.ops.dual_averaging import DualAveraging
  from pyro.ops.welford import WelfordArrowheadCovariance, WelfordCovariance
label_desc: Use image node_id 2 for calling the WarmupAdapter obj's underlying member method code with example usage: obj._build_adaptation_schedule() and returns: adaptation_schedule, adaptation_schedule