|
AQIT 0.1.0
|
Functions | |
| dict[str, Any] | _read_json (Path path) |
| dict[str, Any] | load_capture_root (str|Path path) |
| dict[str, Any] | _flatten_probe_row (dict[str, Any] row, dict[str, dict[str, Any]] probe_lookup) |
| list[tuple[str, str]] | _parse_filter (str|None expr) |
| bool | _matches (dict[str, Any] row, list[tuple[str, str]] filters) |
| dict[str, Any] | replay_capture (str|Path path, *, str|None filter_expr=None, str|None group_by=None, int|None limit=None) |
| dict[str, list[int]] | _probe_groups (list[dict[str, Any]] probes, str field) |
| bool | _usable_groups (dict[str, list[int]] grouped) |
| tuple[str, dict[str, list[int]], bool] | resolve_compare_group (list[dict[str, Any]] probes, str requested) |
| None | _write_json (Path path, dict[str, Any] data) |
| dict[str, Any] | encode_capture_sae_features (str|Path path, *, int|None sae_layer=None, Any|None sae=None) |
| dict[str, Any] | compare_capture_features (str|Path path, *, str group, int top_k=10, bool encode_sae=True, int|None sae_layer=None, Any|None sae=None) |
Variables | |
| tuple | COHORT_FIELDS = ("group", "label", "lang", "stressor", "source") |
|
protected |
Definition at line 70 of file activation_replay.py.
Referenced by replay_capture().
|
protected |
Definition at line 102 of file activation_replay.py.
Referenced by replay_capture().
|
protected |
Definition at line 87 of file activation_replay.py.
Referenced by replay_capture().
|
protected |
Definition at line 165 of file activation_replay.py.
Referenced by resolve_compare_group().
|
protected |
Definition at line 19 of file activation_replay.py.
Referenced by encode_capture_sae_features(), and load_capture_root().
|
protected |
Definition at line 175 of file activation_replay.py.
Referenced by resolve_compare_group().
|
protected |
Definition at line 205 of file activation_replay.py.
Referenced by encode_capture_sae_features().
| dict[str, Any] compare_capture_features | ( | str | Path | path, |
| * | , | ||
| str | group, | ||
| int | top_k = 10, | ||
| bool | encode_sae = True, | ||
| int | None | sae_layer = None, | ||
| Any | None | sae = None ) |
Definition at line 309 of file activation_replay.py.
References encode_capture_sae_features(), load_capture_root(), and resolve_compare_group().
| dict[str, Any] encode_capture_sae_features | ( | str | Path | path, |
| * | , | ||
| int | None | sae_layer = None, | ||
| Any | None | sae = None ) |
Encode residual activations in a capture with the SAE for that layer.
Definition at line 209 of file activation_replay.py.
References _read_json(), _write_json(), and load_capture_root().
Referenced by compare_capture_features().
| dict[str, Any] load_capture_root | ( | str | Path | path | ) |
Definition at line 26 of file activation_replay.py.
References _read_json().
Referenced by compare_capture_features(), encode_capture_sae_features(), and replay_capture().
| dict[str, Any] replay_capture | ( | str | Path | path, |
| * | , | ||
| str | None | filter_expr = None, | ||
| str | None | group_by = None, | ||
| int | None | limit = None ) |
Definition at line 112 of file activation_replay.py.
References _flatten_probe_row(), _matches(), _parse_filter(), and load_capture_root().
| tuple[str, dict[str, list[int]], bool] resolve_compare_group | ( | list[dict[str, Any]] | probes, |
| str | requested ) |
Pick a metadata field with ≥2 cohorts. Last resort: split probes in half.
Definition at line 180 of file activation_replay.py.
References _probe_groups(), and _usable_groups().
Referenced by compare_capture_features().
| tuple aquin.compute.activation_replay.COHORT_FIELDS = ("group", "label", "lang", "stressor", "source") |
Definition at line 162 of file activation_replay.py.