Divergence
Tutorials
Check out this tutorial to begin using the Divergence class
How To Guides
There are currently no how to’s for Divergence. If there are scenarios that you want us to explain, contact us!
DAML API
- class daml.metrics.Divergence(data_a: ndarray, data_b: ndarray, method: Literal['MST', 'FNN'] = 'MST')
Calculates the estimated divergence between two datasets
- Parameters:
data_a (np.ndarray) – Array of images or image embeddings to compare
data_b (np.ndarray) – Array of images or image embeddings to compare
method (Literal["MST, "FNN"], default "MST") – Method used to estimate dataset divergence
Warning
MST is very slow in this implementation, this is unlike matlab where they have comparable speeds Overall, MST takes ~25x LONGER!! Source of slowdown: conversion to and from CSR format adds ~10% of the time diff between 1nn and scipy mst function the remaining 90%
- evaluate() Dict[str, Any]
Calculates the divergence and any errors between the datasets
- Returns:
- dpfloat
divergence value between 0.0 and 1.0
- errorsint
the number of differing edges
- Return type:
Dict[str, Any]