An ordered dictionary including details about the result of `Comparator.compare_accuracy`.
More specifically, it is an OrderedDict[Tuple[str, str], List[OrderedDict[str, bool]]] which maps a runner
pair (a tuple containing both runner names) to a list of dictionaries of booleans (or anything that can be
converted into a boolean, such as an OutputCompareResult), indicating whether there was a match in the outputs of
the corresponding iteration. The List[OrderedDict[str, bool]] is constructed from the dictionaries returned
by `compare_func` in `compare_accuracy`.
For example, to see if there was a match in "output0" between "runner0" and
"runner1" on the 1st iteration, you would do the following:
::
output_name = "output0"
runner_pair = ("runner0", "runner1")
iteration = 0
match = bool(accuracy_result[runner_pair][iteration][output_name])
In case there's a mismatch, you would be able to inspect the outputs in question by accessing
the results from Comparator.run() (assumed here to be called run_results):
::
runner0_output = run_results["runner0"][iteration][output_name]
runner1_output = run_results["runner1"][iteration][output_name]
def polygraphy.comparator.struct.AccuracyResult.stats |
( |
|
self, |
|
|
|
runner_pair = None |
|
) |
| |
Returns the number of iterations that matched, mismatched, and the total number of iterations.
Args:
runner_pair ((str, str)):
A pair of runner names describing which runners to check.
Defaults to the first pair in the dictionary.
Returns:
(int, int, int): Number of iterations that matched, mismatched, and total respectively.