Visualization Guide
CLI usage, programmatic API, and plotting for symbol activations, latent channels, state vectors, and relations.
ARIA Visualization Guide
This document describes the visualization tools for ARIA core outputs. These tools provide read-only analysis and plotting of numeric data from ARIA runs.
Overview
The ARIA visualization package (tools/aria_visualization/) provides visualizers for each ARIA core version:
| Module | ARIA Version | Key Outputs |
|---|---|---|
visual_symbols.py | v1 | 8-symbol activations, entropy, stability |
visual_latents.py | v0 | 5 latent channels, 4 cluster memberships |
visual_state.py | v2 | 12-dim SSV, drift/coherence indices |
visual_relations.py | v3 | 8x8 relation matrix, 12-dim RSV |
All tools operate on JSON output from aria_local_loop.py.
Safety Invariants
- Read-only: Visualization tools never modify model behavior
- No identity inference: Outputs are numeric only
- No semantic interpretation: Patterns are displayed, not labeled
- Deterministic: Same input produces same output
- Offline: No network access required
Installation
The visualization tools require:
- Python 3.8+
- matplotlib
- numpy
- networkx (optional, for graph plots)
pip install matplotlib numpy networkx
Quick Start
Unified CLI
The simplest way to generate all visualizations:
# Generate all visualizations
python tools/aria_visualize.py -i run.json -m all -d ./output/
# Generate only symbol visualizations
python tools/aria_visualize.py -i run.json -m symbols -o symbols.png
# Get statistics as JSON
python tools/aria_visualize.py -i run.json --stats
# Show run info
python tools/aria_visualize.py -i run.json --info
Individual Visualizers
Each visualizer can also be used directly:
# Symbol heatmap
python tools/aria_visualization/visual_symbols.py -i run.json -t heatmap -o heatmap.png
# Latent channel traces
python tools/aria_visualization/visual_latents.py -i run.json -t channels -o channels.png
# SSV heatmap
python tools/aria_visualization/visual_state.py -i run.json -t heatmap -o ssv.png
# Relation matrix
python tools/aria_visualization/visual_relations.py -i run.json -t heatmap -o relations.png
Visualizer Details
SymbolVisualizer (ARIA v1)
Visualizes the 8-symbol proto-symbolic layer outputs.
Data Requirements:
aria_core.symbol_activations- Dict with k_0 through k_7aria_core.symbol_entropy- Entropy of symbol distributionaria_core.symbol_stability- Temporal stabilityaria_core.dominant_symbol- Index of most active symbol
Plot Types:
| Type | Description |
|---|---|
heatmap | 8xN heatmap of symbol activations over time |
traces | Individual line plots for each symbol (4x2 grid) |
metrics | Entropy, stability, dominant symbol over time |
all | Generate all plot types |
Example:
from tools.aria_visualization import SymbolVisualizer
from tools.aria_visualization.utils import load_run_json
data = load_run_json('run.json')
viz = SymbolVisualizer(data)
# Generate single plot
viz.plot_symbol_heatmap('heatmap.png')
# Generate all plots
viz.plot_all('./output/', prefix='symbols')
# Get statistics
stats = viz.get_statistics()
print(f"Mean entropy: {stats['entropy']['mean']:.4f}")
LatentVisualizer (ARIA v0)
Visualizes the 5-dimensional latent field and 4-cluster attractor space.
Data Requirements:
aria_core.latent_channels- List of 5 floats [L_0, ..., L_4]aria_core.cluster_memberships- List of 4 floats (sum to 1.0)aria_core.cluster_entropy- Entropy of cluster distributionaria_core.stability_gate- Gate state [0, 1]aria_core.dominant_cluster- Index of dominant cluster
Plot Types:
| Type | Description |
|---|---|
channels | 5 stacked line plots of latent channels |
heatmap | 5xN heatmap of channels over time |
clusters | Stacked area chart of cluster memberships |
gate | Gate state and dominant cluster over time |
trajectory | 2D trajectory in first two latent dimensions |
all | Generate all plot types |
Cluster Names:
- Cluster 0: Balanced
- Cluster 1: Coherence-Dominant
- Cluster 2: Energy-Dominant
- Cluster 3: Stability-Dominant
StateVisualizer (ARIA v2)
Visualizes the 12-dimensional System State Vector (SSV).
Data Requirements:
aria_core.system_state_vectororaria_core.ssv- 12-dim listaria_core.state_entropy- SSV entropyaria_core.state_stability- SSV temporal stabilityaria_core.drift_index- Aggregate drift measurearia_core.coherence_index- Cross-layer coherence- Change detection:
rate_of_change,structural_drift,symbolic_turnover,attractor_transition
SSV Dimensions:
| Index | Name | Source |
|---|---|---|
| s0 | substrate_coherence | CFM |
| s1 | substrate_stability | CFM |
| s2 | latent_field_mean | v0 |
| s3 | latent_field_variance | v0 |
| s4 | cluster_dominance | v0 |
| s5 | cluster_entropy | v0 |
| s6 | symbol_focus | v1 |
| s7 | symbol_persistence | v1 |
| s8 | symbol_strength | v1 |
| s9 | cross_layer_alignment | v0+v1 |
| s10 | temporal_smoothness | history |
| s11 | system_energy | all |
Plot Types:
| Type | Description |
|---|---|
heatmap | 12xN heatmap with group separators |
traces | 12 individual dimension traces (4x3 grid) |
grouped | Dimensions grouped by source layer |
metrics | Entropy, stability, drift, coherence |
change | Change detection metrics |
radar | Radar chart comparing snapshots |
all | Generate all plot types |
RelationVisualizer (ARIA v3)
Visualizes the 8x8 relation matrix and 12-dimensional Relational Summary Vector (RSV).
Data Requirements:
aria_core.relation_matrix- 8x8 matrix of symbol relationsaria_core.rsv- 12-dim summary vectoraria_core.relation_entropy- Matrix entropyaria_core.plasticity_index- Learning rate indicatoraria_core.relation_stability- Temporal stability
RSV Dimensions:
| Index | Name | Description |
|---|---|---|
| r0 | mean_strength | Mean relation strength |
| r1 | sparsity | Fraction of weak relations |
| r2 | symmetry | Matrix symmetry measure |
| r3 | clustering | Local clustering coefficient |
| r4 | dominance | Max relation strength |
| r5 | entropy | Relation distribution entropy |
| r6 | stability | Temporal stability |
| r7 | reciprocity | Bidirectional relation measure |
| r8 | hierarchy | Hierarchical structure |
| r9 | modularity | Cluster modularity |
| r10 | centrality | Central node measure |
| r11 | plasticity | Learning/change rate |
Plot Types:
| Type | Description |
|---|---|
heatmap | 8x8 relation matrix at final snapshot |
evolution | Matrix evolution across snapshots |
graph | NetworkX graph with weighted edges |
rsv | 12-dim RSV traces over time |
radar | RSV radar chart at selected snapshots |
plasticity | Plasticity and relation metrics |
all | Generate all plot types |
Programmatic Usage
Basic Usage
from tools.aria_visualization import (
SymbolVisualizer,
LatentVisualizer,
StateVisualizer,
RelationVisualizer,
)
from tools.aria_visualization.utils import load_run_json
# Load data
data = load_run_json('run.json')
# Create visualizers
sym_viz = SymbolVisualizer(data)
lat_viz = LatentVisualizer(data)
state_viz = StateVisualizer(data)
rel_viz = RelationVisualizer(data)
# Extract data for custom analysis
steps, activations = sym_viz.extract_symbol_activations()
steps, ssv_series = state_viz.extract_ssv_time_series()
# Generate plots
sym_viz.plot_all('./output/', prefix='run1')
Custom Plots
import matplotlib.pyplot as plt
import numpy as np
from tools.aria_visualization import StateVisualizer
from tools.aria_visualization.utils import load_run_json
data = load_run_json('run.json')
viz = StateVisualizer(data)
# Get raw data
steps, ssv_series = viz.extract_ssv_time_series()
ssv_array = np.array(ssv_series)
# Custom plot: coherence vs energy
fig, ax = plt.subplots()
ax.scatter(ssv_array[:, 0], ssv_array[:, 11], c=steps, cmap='viridis')
ax.set_xlabel('Substrate Coherence (s0)')
ax.set_ylabel('System Energy (s11)')
ax.set_title('Coherence-Energy Phase Space')
plt.colorbar(ax.collections[0], label='Step')
plt.savefig('coherence_energy.png')
Statistics
from tools.aria_visualization import StateVisualizer
from tools.aria_visualization.utils import load_run_json
import json
data = load_run_json('run.json')
viz = StateVisualizer(data)
stats = viz.get_statistics()
print(json.dumps(stats, indent=2))
Output:
{
"num_steps": 100,
"derived_metrics": {
"state_entropy": {"min": 0.32, "max": 0.68, "mean": 0.52, "std": 0.08},
"drift_index": {"min": 0.01, "max": 0.18, "mean": 0.07, "std": 0.04}
},
"ssv_means": {
"coh": 0.72,
"stab": 0.68,
...
}
}
Utility Functions
The utils.py module provides common functions:
from tools.aria_visualization.utils import (
load_run_json, # Load JSON file
extract_snapshots, # Get snapshots list
extract_time_series, # Extract dot-path values
get_steps, # Get step numbers
compute_statistics, # Min/max/mean/std
ensure_output_dir, # Create output directory
safe_filename, # Sanitize filenames
has_detailed_output, # Check for detailed data
)
Generating Sample Data
For testing without running ARIA:
# Generate test run with aria_local_loop
python tools/aria_local_loop.py \
--core aria_v3 \
--steps 100 \
--dt 0.1 \
--detailed \
--output test_run.json
# Visualize
python tools/aria_visualize.py -i test_run.json -m all -d ./viz/
Troubleshooting
"No symbol activations found"
The JSON file may not contain detailed output. Re-run with --detailed:
python tools/aria_local_loop.py --core aria_v1 --detailed -o run.json
"matplotlib not available"
Install visualization dependencies:
pip install matplotlib numpy
"NetworkX required for graph plots"
Install networkx for relation graph visualization:
pip install networkx
Empty plots
Check that snapshots contain the expected fields:
from tools.aria_visualization.utils import load_run_json, has_detailed_output
data = load_run_json('run.json')
print(f"Has detailed output: {has_detailed_output(data)}")
print(f"Num snapshots: {len(data.get('snapshots', []))}")
File Naming
When using plot_all(), files are named as:
{prefix}_{plot_type}.png
For example, with prefix run1:
run1_heatmap.pngrun1_traces.pngrun1_metrics.png
Integration with aria_local_loop
The visualization tools are designed to work with output from aria_local_loop.py:
# Run ARIA with detailed output
python tools/aria_local_loop.py \
--core aria_v3 \
--steps 200 \
--dt 0.1 \
--detailed \
--output my_run.json
# Generate visualizations
python tools/aria_visualize.py \
-i my_run.json \
-m all \
-d ./visualizations/ \
-p my_run
See Also
- ARIA Core Overview - Core architecture documentation
- ARIA Core v2 Specification - SSV details
- ARIA Core v3 Specification - Relation matrix details