def __init__(self, param, stat_name, value_func, threshold,
                 last_k, reverse=False):
        """
        Args:
            param: same as in :class:`HyperParamSetter`.
            stat_name (str): name of the statistics.
            value_func (float -> float): a function which returns a new value
                taking the old value.
            threshold (float): change threshold.
            last_k (int): use last k observations of statistics.
            reverse (bool): monitor increasing instead of decreasing.
                If True, ``param`` will be changed when ``max(history) <= history[0] + threshold``.
        """
        super(StatMonitorParamSetter, self).__init__(param)
        self.stat_name = stat_name
        self.value_func = value_func
        self.history = deque(maxlen=last_k)
        self.threshold = threshold
        self.reverse = reverse

        Args:
            param: same as in :class:`HyperParamSetter`.
            stat_name (str): name of the statistics.
            value_func (float -> float): a function which returns a new value
                taking the old value.
            threshold (float): change threshold.
            last_k (int): use last k observations of statistics.
            reverse (bool): monitor increasing instead of decreasing.
                If True, ``param`` will be changed when ``max(history) <= history[0] + threshold``.
        
tensorpack/callbacks/param.py