class_docstr: Piecewise linear state parameter scheduler.
  
  Args:
      milestones_values: list of tuples (event index, parameter value)
          represents milestones and parameter values. Milestones should be increasing integers.
      param_name: name of parameter to update.
      save_history: whether to log the parameter values to
          `engine.state.param_history`, (default=False).
      create_new: whether to create ``param_name`` on
          ``engine.state`` taking into account whether
          ``param_name`` attribute already exists or not.
          Overrides existing attribute by default, (default=False).
  
  Examples:
  
      .. include:: defaults.rst
          :start-after: :orphan:
  
      .. testcode::
  
          default_trainer = get_default_trainer()
  
          param_scheduler = PiecewiseLinearStateScheduler(
              param_name="param",  milestones_values=[(5, 1.0), (10, 0.8), (15, 0.6)], create_new=True
          )
  
          # parameter is param, milestone (5, 1.0) sets param to 1.0
          # milestone is (5, 1.0), param=1  for Epoch 1 to 5,
          # next milestone is (10, 0.8), param linearly reduces from 1.0 to 0.8
          # Epoch 10, param = 0.8
          # next milestone is (15,0.6), param linearly reduces from 0.8 to 0.6
          # Epoch 15, param = 0.6
  
          param_scheduler.attach(default_trainer, Events.EPOCH_COMPLETED)
  
          @default_trainer.on(Events.EPOCH_COMPLETED)
          def print_param():
              print(default_trainer.state.param)
  
          default_trainer.run([0], max_epochs=15)
  
      .. testoutput::
  
          1.0
          1.0
          1.0
          1.0
          1.0
          0.96
          0.92
          0.88
          0.8400...
          0.8
          0.76
          0.72
          0.68
          0.64
          0.6
  
  .. versionadded:: 0.4.7
class_docstr_tok: ["Piecewise","linear","state","parameter","scheduler",".","Args",":","milestones_values",":","list","of","tuples","(","event","index",",","parameter","value",")","represents","milestones","and","parameter","values",".","Milestones","should","be","increasing","integers",".","param_name",":","name","of","parameter","to","update",".","save_history",":","whether","to","log","the","parameter","values","to","`","engine.state.param_history","`",",","(","default=False",")",".","create_new",":","whether","to","create","``","param_name","``","on","``","engine.state","``","taking","into","account","whether","``","param_name","``","attribute","already","exists","or","not",".","Overrides","existing","attribute","by","default",",","(","default=False",")",".","Examples",":","..","include",":",":","defaults.rst",":","start-after",":",":","orphan",":","..","testcode",":",":","default_trainer","=","get_default_trainer","(",")","param_scheduler","=","PiecewiseLinearStateScheduler","(","param_name=","''","param","''",",","milestones_values=","[","(","5",",","1.0",")",",","(","10",",","0.8",")",",","(","15",",","0.6",")","]",",","create_new=True",")","#","parameter","is","param",",","milestone","(","5",",","1.0",")","sets","param","to","1.0","#","milestone","is","(","5",",","1.0",")",",","param=1","for","Epoch","1","to","5",",","#","next","milestone","is","(","10",",","0.8",")",",","param","linearly","reduces","from","1.0","to","0.8","#","Epoch","10",",","param","=","0.8","#","next","milestone","is","(","15,0.6",")",",","param","linearly","reduces","from","0.8","to","0.6","#","Epoch","15",",","param","=","0.6","param_scheduler.attach","(","default_trainer",",","Events.EPOCH_COMPLETED",")","@","default_trainer.on","(","Events.EPOCH_COMPLETED",")","def","print_param","(",")",":","print","(","default_trainer.state.param",")","default_trainer.run","(","[","0","]",",","max_epochs=15",")","..","testoutput",":",":","1.0","1.0","1.0","1.0","1.0","0.96","0.92","0.88","0.8400","...","0.8","0.76","0.72","0.68","0.64","0.6","..","versionadded",":",":","0.4.7"]
code: def get_param(self) -> Union[List[float], float]:
      (
          start_index,
          end_index,
          start_value,
          end_value,
      ) = self._get_start_end()
      return start_value + (end_value - start_value) * (
          self.event_index - start_index
      ) / (end_index - start_index)
  
imports: import numbers
  import warnings
  from bisect import bisect_right
  from typing import Any, List, Sequence, Tuple, Union
  from ignite.engine import CallableEventWithFilter, Engine, Events, EventsList
  from ignite.handlers.param_scheduler import BaseParamScheduler
label_desc: Use image node_id 3 for calling the PiecewiseLinearStateScheduler obj's underlying member method code with example usage: obj.get_param() and returns: unknown