Prune scores similarity
auto_circuit.metrics.prune_scores_similarity
Attributes
Functions
prune_score_similarities
prune_score_similarities(algo_prune_scores: AlgoPruneScores, edge_counts: List[int]) -> Dict[int, Dict[AlgoKey, Dict[AlgoKey, float]]]
Measure the similarity between the prune scores of different algorithms. Similarity is measured as the proportion of the top N prune scores that are common between two algorithms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
algo_prune_scores |
AlgoPruneScores
|
Prune scores for each algorithm. |
required |
edge_counts |
List[int]
|
The number of edges in the circuit to consider. |
required |
Returns:
Type | Description |
---|---|
Dict[int, Dict[AlgoKey, Dict[AlgoKey, float]]]
|
A dictionary mapping from the number of edges considered to the overlap between
|
Source code in auto_circuit/metrics/prune_scores_similarity.py
prune_score_similarities_plotly
prune_score_similarities_plotly(task_prune_scores: TaskPruneScores, edge_counts: List[int], ground_truths: bool = False) -> Figure
Create a Plotly heatmap figure showing the similarity between the prune scores of different algorithms.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_prune_scores |
TaskPruneScores
|
Prune scores for each algorithm for each task. |
required |
edge_counts |
List[int]
|
The number of edges in the circuit to consider. |
required |
ground_truths |
bool
|
Whether to include the official circuit edge counts in addition
to |
False
|
Returns:
Type | Description |
---|---|
Figure
|
A Plotly figure. |
Source code in auto_circuit/metrics/prune_scores_similarity.py
task_prune_scores_similarities
task_prune_scores_similarities(task_prune_scores: TaskPruneScores, edge_counts: List[int], true_edge_counts: bool = False) -> Dict[TaskKey, Dict[int, Dict[AlgoKey, Dict[AlgoKey, float]]]]
Wrapper around
prune_score_similarities
for a set of tasks.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
true_edge_counts |
bool
|
Whether to include the official circuit edge count in addition
to |
False
|