plot_topk_overlap_heatmap
Plot pairwise top-k overlap between GRADIEND models.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
models
|
Dict[str, object]
|
Mapping of display/model ids to GRADIEND models. |
required |
topk
|
Union[int, float]
|
Number or fraction of top weights to compare. |
1000
|
part
|
str
|
Model part used to select weights. |
'decoder-weight'
|
value
|
str
|
Overlap value to display. |
'intersection'
|
order
|
Union[str, List[str]]
|
|
'input'
|
cluster
|
bool
|
Whether to cluster rows/columns. |
False
|
annot
|
Union[bool, str]
|
Whether/how to annotate cells. |
'auto'
|
fmt
|
Optional[str]
|
Deprecated alias for |
None
|
annot_fmt
|
Optional[str]
|
Cell annotation format. |
None
|
figsize
|
Optional[Tuple[float, float]]
|
Optional figure size. |
None
|
cmap
|
str
|
Heatmap colormap. |
'viridis'
|
vmin
|
Optional[float]
|
Optional lower value bound. |
None
|
vmax
|
Optional[float]
|
Optional upper value bound. |
None
|
title
|
Optional[Union[str, bool]]
|
Optional plot title, or False to omit. |
False
|
output_path
|
Optional[str]
|
Optional output path. |
None
|
show
|
bool
|
Whether to display the plot. |
True
|
return_data
|
bool
|
Whether to include computed data in the return payload. |
True
|
return_fig_ax
|
bool
|
Whether to include matplotlib figure/axis. |
False
|
ax
|
Optional[object]
|
Optional existing matplotlib axis. |
None
|
pretty_groups
|
Optional[Dict[str, List[str]]]
|
Optional model-id groups displayed as brackets. |
None
|
scale
|
str
|
Color scale type. |
'linear'
|
scale_gamma
|
Optional[float]
|
Optional gamma for power scaling. |
None
|
annot_fontsize
|
Optional[Union[int, float]]
|
Optional annotation font size. |
None
|
tick_label_fontsize
|
Optional[Union[int, float]]
|
Optional tick-label font size. |
None
|
group_label_fontsize
|
Optional[Union[int, float]]
|
Optional group-label font size. |
None
|
group_label_rotation_top
|
Union[int, float]
|
Rotation for top group labels. |
0
|
group_label_rotation_right
|
Union[int, float]
|
Rotation for right group labels. |
0
|
cbar_pad
|
Optional[float]
|
Optional colorbar padding. |
None
|
cbar_y_pad
|
Optional[float]
|
Optional vertical colorbar offset as a fraction of the heatmap height; negative values move it down. |
None
|
cbar_fontsize
|
Optional[Union[int, float]]
|
Optional colorbar font size. |
None
|
cbar_shrink
|
Optional[float]
|
Optional colorbar shrink factor (width relative to heatmap). |
None
|
percentages
|
bool
|
Whether overlap values are shown as percentages. |
True
|
row_metric
|
Optional[Dict[str, float]]
|
Optional side metric by row id. |
None
|
row_metric_label
|
Optional[str]
|
Label for the side metric. |
'corr'
|
row_metric_cmap
|
str
|
Colormap for the side metric. |
'magma'
|
row_metric_vmin
|
Optional[float]
|
Optional side-metric lower bound. |
None
|
row_metric_vmax
|
Optional[float]
|
Optional side-metric upper bound. |
None
|
row_label_mapping
|
Optional[Dict[str, str]]
|
Optional mapping for row display labels. |
None
|
column_label_mapping
|
Optional[Dict[str, str]]
|
Optional mapping for column display labels. |
None
|
highlight_non_convergence
|
bool
|
Whether labels mark non-converged runs. |
True
|
seed_pairing_mode
|
str
|
|
'matched'
|
converged_by_id
|
Optional[Dict[str, Optional[bool]]]
|
Optional explicit convergence status by stable model id. |
None
|
Source code in gradiend/visualizer/topk/pairwise_heatmap.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | |