code: def sgdr_phases(
      base_cycle_length: int,
      cycles: int,
      lr: Tuple[float, float] = (1.0, 0.1),
      cycle_mult: int = 2,
  ) -> List[Phase]:
      """
      The "SGDR" policy as described in the paper `SGDR: Stochastic Gradient Descent with Warm Restarts
      <https://arxiv.org/abs/1608.03983>`_.
  
      Note the total number of steps is calculated like this: `total_steps = sum(base_cycle_length *
      (cycle_mult ** i) for i in range(cycles))`
  
      You might want to read the paper and adjust the parameters.
  
      Args:
          base_cycle_length (int): number of steps for the first cycle.
          cycles (int): the number of repetitions.
          lr (Typle[float, float]): tuple for the learning rate for one cycle: (start, end).
          cycle_mult (float): multiply the last cycle length with this every cycle. The length of a cycle
              grows exponentially.
  
      Returns:
          A list of configured :class:`~poutyne.Phase` instances.
  
      References:
          `SGDR: Stochastic Gradient Descent with Warm Restarts
          <https://arxiv.org/abs/1608.03983>`_
      """
      steps = [
          base_cycle_length * (cycle_mult**i) for i in range(cycles)
      ]
      return [
          Phase(lr=cosinespace(lr[0], lr[1], step)) for step in steps
      ]
  
imports: import contextlib
  from collections import OrderedDict
  from itertools import chain, islice
  from math import cos, pi
  from typing import Dict, List, Optional, Tuple
  from poutyne.framework.callbacks.callbacks import Callback
label_desc: Use image node_id 2 for calling a global function with example usage: sgdr_phases(base_cycle_length, cycles, lr, cycle_mult) and returns: unknown