afe.apis.statistic
Source: afe/apis/statistic.py
Analysis of statistics on tensors.
Imports
afe.apis.compilation_job_base.Tensorafe.core.evaluate_networks.checked_zipafe.driver.statistic.Statisticdataclassesnumpy as nptyping.Anytyping.Callabletyping.Generictyping.Listtyping.Tupletyping.Typetyping.TypeVar
Constants
Functions
-
equality(x: Tensor, y: Tensor) -> float(line 31): Equality as a distance metric.Parameters:
x: typeTensory: typeTensor
Returns: float
-
mean_float(x: Tensor, y: Tensor) -> float(line 40): Mean value of difference between input values and ground truth values.Parameters:
x: typeTensory: typeTensor
Returns: float
-
threshold_test_counter(metric: Metric, threshold: float) -> Statistic[Tuple[Tensor, Tensor], str](line 58): Create a Statistic over a stream of (x, y) pairs that counts the number of times metric(x, y) < threshold is satisfied.Parameters:
metric: Distance metricthreshold: Threshold to compare against
Returns: Statistic that captures the data
-
tensor_set_statistics(statistics: List[Statistic[Tuple[Any, Any], str]]) -> Statistic[Tuple[List[Any], List[Any]], str](line 82): Apply an independent Statistic to each tensor in a stream of pairs of fixed-length lists.Parameters:
statistics: Statistic to apply to each pair of values
Returns: Composed statistic that applies the statistics to list items
-
mean(metric: Metric) -> Statistic[Tuple[List[Tensor], Tensor], float](line 114): Create a statistic that takes input pairs (i, g) and computes the arithmetic mean of metric(i, g) over all given inputs.Parameters:
metric: Mean metric.
Returns: Statistic that captures the data
-
mean_text(metric: Metric) -> Statistic[Tuple[List[Tensor], Tensor], str](line 136): Create a statistic that takes input pairs (i, g) and computes the arithmetic mean of metric(i, g) over all given inputs and formats the results as text message.Parameters:
metric: Mean metric.
Returns: Statistic that captures the data