class_docstr: Set the parameter by a function of epoch num and old value. 
docstr: Args:
      param: same as in :class:`HyperParamSetter`.
      func: ``param`` will be set by ``new_value = func(epoch_num, old_value)``.
          ``epoch_num`` is the number of epochs that have finished.
  
  Example:
      Decrease by a factor of 0.9 every two epochs:
  
      .. code-block:: python
  
          HyperParamSetterWithFunc('learning_rate',
                                   lambda e, x: x * 0.9 if e % 2 == 0 else x)
docstr_tok: ["Args",":","param",":","same","as","in",":","class",":","`","HyperParamSetter","`",".","func",":","``","param","``","will","be","set","by","``","new_value","=","func","(","epoch_num",",","old_value",")","``",".","``","epoch_num","``","is","the","number","of","epochs","that","have","finished",".","Example",":","Decrease","by","a","factor","of","0.9","every","two","epochs",":","..","code-block",":",":","python","HyperParamSetterWithFunc","(","'learning_rate","'",",","lambda","e",",","x",":","x","*","0.9","if","e","%","2","==","0","else","x",")"]
code: def __init__(self, param, func):
      """
      Args:
          param: same as in :class:`HyperParamSetter`.
          func: ``param`` will be set by ``new_value = func(epoch_num, old_value)``.
              ``epoch_num`` is the number of epochs that have finished.
  
      Example:
          Decrease by a factor of 0.9 every two epochs:
  
          .. code-block:: python
  
              HyperParamSetterWithFunc('learning_rate',
                                       lambda e, x: x * 0.9 if e % 2 == 0 else x)
      """
      super(HyperParamSetterWithFunc, self).__init__(param)
      self.f = func
  
imports: import operator
  import os
  import numpy
  from abc import ABCMeta, abstractmethod
  from collections import deque
  import six
  from ..compat import tfv1
  from ..tfutils.common import get_op_tensor_name
  from ..utils import logger
  from .base import Callback
label_desc: Use image node_id 1 to create a new HyperParamSetterWithFunc object from inherited base classes: HyperParamSetter with example: obj = HyperParamSetterWithFunc(param, func)