docstr: Exponentially decreasing between :math:`w_{start}` and :math:`w_{end}`
  The velocity is adjusted such that the following equation holds:
  
  Defaults: :math:`d_{1}=2, d_{2}=7, w^{end} = 0.4, c^{end}_{1} = 0.8 * c^{start}_{1}, c^{end}_{2} = c^{start}_{2}`
  
  .. math::
          w = (w^{start}-w^{end}-d_{1})exp(\frac{1}{1+ \frac{d_{2}.iter}{iter^{max}}})
          
  Ref: Li, H.-R., & Gao, Y.-L. (2009). Particle Swarm Optimization Algorithm with Exponent
  Decreasing Inertia Weight and Stochastic Mutation. 2009 Second International Conference
  on Information and Computing Science. doi:10.1109/icic.2009.24
docstr_tok: ["Exponentially","decreasing","between",":","math",":","`","w_","{","start","}","`","and",":","math",":","`","w_","{","end","}","`","The","velocity","is","adjusted","such","that","the","following","equation","holds",":","Defaults",":",":","math",":","`","d_","{","1","}","=2",",","d_","{","2","}","=7",",","w^","{","end","}","=","0.4",",","c^","{","end","}","_","{","1","}","=","0.8","*","c^","{","start","}","_","{","1","}",",","c^","{","end","}","_","{","2","}","=","c^","{","start","}","_","{","2","}","`","..","math",":",":","w","=","(","w^","{","start","}","-w^","{","end","}","-d_","{","1","}",")","exp","(","\\frac","{","1","}","{","1+","\\frac","{","d_","{","2","}",".iter","}","{","iter^","{","max","}","}","}",")","Ref",":","Li",",","H.-R.",",","&","Gao",",","Y.-L.","(","2009",")",".","Particle","Swarm","Optimization","Algorithm","with","Exponent","Decreasing","Inertia","Weight","and","Stochastic","Mutation",".","2009","Second","International","Conference","on","Information","and","Computing","Science",".","doi:10.1109\/icic.2009.24"]
code: def exp_decay(self, start_opts, opt, **kwargs):
      """Exponentially decreasing between :math:`w_{start}` and :math:`w_{end}`
      The velocity is adjusted such that the following equation holds:
  
      Defaults: :math:`d_{1}=2, d_{2}=7, w^{end} = 0.4, c^{end}_{1} = 0.8 * c^{start}_{1}, c^{end}_{2} = c^{start}_{2}`
  
      .. math::
              w = (w^{start}-w^{end}-d_{1})exp(\\frac{1}{1+ \\frac{d_{2}.iter}{iter^{max}}})
  
      Ref: Li, H.-R., & Gao, Y.-L. (2009). Particle Swarm Optimization Algorithm with Exponent
      Decreasing Inertia Weight and Stochastic Mutation. 2009 Second International Conference
      on Information and Computing Science. doi:10.1109/icic.2009.24
  
      """
  
      try:
          # default values from reference paper
          if "d1" not in kwargs:
              d1 = 0.2
          else:
              d1 = kwargs["d1"]
          if "d2" not in kwargs:
              d2 = 7
          else:
              d2 = kwargs["d2"]
  
          end_opts = {
              "w": 0.4,
              "c1": 0.8 * start_opts["c1"],
              "c2": 1 * start_opts["c2"],
          }
          if "end_opts" in kwargs:
              if opt in kwargs["end_opts"]:
                  end_opts[opt] = kwargs["end_opts"][opt]
          start = start_opts[opt]
          end = end_opts[opt]
          new_val = (start - end - d1) * math.exp(
              1 / (1 + d2 * kwargs["iternow"] / kwargs["itermax"])
          )
      except KeyError:
          self.rep.logger.exception(
              "Keyword 'itermax' or 'iternow' missing"
          )
          raise
      else:
          return new_val
  
imports: import inspect
  import logging
  import numpy
  import math
  from copy import copy
  from ..utils.reporter import Reporter
label_desc: Use image node_id 3 for calling the OptionsHandler obj's underlying member method code with example usage: obj.exp_decay(start_opts, opt) and returns: new_val