File size: 430 Bytes
57decc6
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
from __future__ import annotations


def inv_metric_cmp_fn(current_metric: float, prev_best: float) -> bool:
    """
    This inverts comparison for those metrics which reduce like loss values, such that the lower one is better.

    Args:
        current_metric: metric value of current round computation.
        prev_best: the best metric value of previous rounds to compare with.
    """
    return current_metric < prev_best