def __init__(self,
                 long_term: int=50,
                 short_term: int=10,
                 stream: str='valid',
                 variable: str='loss',
                 objective: str='min',
                 **kwargs):
        """
        Create new OnPlateau hook.

        :param long_term: count of last epochs representing long training period
        :param short_term: count of last epochs representing short training period
        :param stream: name of the processed stream
        :param variable: name of the observed variable
        :param objective: observed variable objective; one of :py:attr:`OnPlateau.OBJECTIVES`
        :param kwargs: ignored

        :raise AssertionError: if ``long_term`` < ``short_term``
        """

        super().__init__(variables={variable: [OnPlateau._AGGREGATION]}, **kwargs)

        assert long_term >= short_term, '``long_term`` can not be smaller than ``short_term``'
        self._long_term = long_term
        self._short_term = short_term
        self._stream = stream
        self._variable = variable
        self._objective = objective
        self._saved_loss = []
def __init__ ( self , long_term : int = 50 , short_term : int = 10 , stream : str = 'valid' , variable : str = 'loss' , objective : str = 'min' , ** kwargs ) : super ( ) . __init__ ( variables = { variable : [ OnPlateau . _AGGREGATION ] } , ** kwargs ) assert long_term >= short_term , '``long_term`` can not be smaller than ``short_term``' self . _long_term = long_term self . _short_term = short_term self . _stream = stream self . _variable = variable self . _objective = objective self . _saved_loss = [ ]
Create new OnPlateau hook.

        :param long_term: count of last epochs representing long training period
        :param short_term: count of last epochs representing short training period
        :param stream: name of the processed stream
        :param variable: name of the observed variable
        :param objective: observed variable objective; one of :py:attr:`OnPlateau.OBJECTIVES`
        :param kwargs: ignored

        :raise AssertionError: if ``long_term`` < ``short_term``