deeppavlov/core/models/lr_scheduled_model.py
def _get_best(values: List[float], losses: List[float],
                  max_loss_div: float = 0.9, min_val_div: float = 10.0) -> float:
        """
        Find the best value according to given losses

        Args:
            values: list of considered values
            losses: list of obtained loss values corresponding to `values`
            max_loss_div: maximal divergence of loss to be considered significant
            min_val_div: minimum divergence of loss to be considered significant

        Returns:
            best value divided by `min_val_div`
        """
        assert len(values) == len(losses), "lengths of values and losses should be equal"
        min_ind = np.argmin(losses)
        for i in range(min_ind - 1, 0, -1):
            if (losses[i] * max_loss_div > losses[min_ind]) or\
                    (values[i] * min_val_div < values[min_ind]):
                return values[i + 1]
        return values[min_ind] / min_val_div
def _get_best(values: List[float], losses: List[float],
                  max_loss_div: float = 0.9, min_val_div: float = 10.0) -> float:
        assert len(values) == len(losses), "lengths of values and losses should be equal"
        min_ind = np.argmin(losses)
        for i in range(min_ind - 1, 0, -1):
            if (losses[i] * max_loss_div > losses[min_ind]) or\
                    (values[i] * min_val_div < values[min_ind]):
                return values[i + 1]
        return values[min_ind] / min_val_div
def _get_best ( values : List [ float ] , losses : List [ float ] , max_loss_div : float = 0.9 , min_val_div : float = 10.0 ) -> float : assert len ( values ) == len ( losses ) , "lengths of values and losses should be equal" min_ind = np . argmin ( losses ) for i in range ( min_ind - 1 , 0 , - 1 ) : if ( losses [ i ] * max_loss_div > losses [ min_ind ] ) or ( values [ i ] * min_val_div < values [ min_ind ] ) : return values [ i + 1 ] return values [ min_ind ] / min_val_div
Find the best value according to given losses

        Args:
            values: list of considered values
            losses: list of obtained loss values corresponding to `values`
            max_loss_div: maximal divergence of loss to be considered significant
            min_val_div: minimum divergence of loss to be considered significant

        Returns:
            best value divided by `min_val_div`
Find the best value according to given losses