Motion Language Examples
**Features:** - 2D trajectory plots with time-coded coloring - 3D latent space visualization (X, Y, Commitment) - Anticipation signal plots (commitment, uncertainty, transition pressure)
Full Public Reader
Motion Language Examples
Proof-of-concept implementations demonstrating motion-to-semantic-meaning translation.
Examples
1. Latent Trajectory Visualization
File: `latent_trajectory_viz.py`
Visualizes how different gestures trace characteristic paths through the latent embedding space.
# Show all gesture trajectories
python latent_trajectory_viz.py --show
# Save specific gesture visualization
python latent_trajectory_viz.py --gesture swipe_left --output swipe.png
# Generate comparison figure
python latent_trajectory_viz.py --output all_gestures.pngFeatures:
- 2D trajectory plots with time-coded coloring
- 3D latent space visualization (X, Y, Commitment)
- Anticipation signal plots (commitment, uncertainty, transition pressure)
2. Gesture Pattern Clustering
File: `gesture_clustering.py`
Demonstrates clustering of gesture embeddings to validate the taxonomy from GESTURE_LEXICON.md.
# Run clustering analysis with default settings
python gesture_clustering.py --show
# Generate more samples for robust statistics
python gesture_clustering.py --n-samples 100 --output clusters.png
# Adjust noise level for sensitivity analysis
python gesture_clustering.py --noise 0.1 --showOutput:
- Silhouette scores for each clustering method
- Adjusted Rand Index (ARI) comparing to ground truth
- Cluster purity metrics
- Visual comparison of clustering results
3. Intent Classification Demo
File: `intent_classification.py`
Complete pipeline demonstration: motion signals → gestures → intents.
# Run standard demo
python intent_classification.py
# Interactive mode (future)
python intent_classification.py --demo interactivePipeline stages:
1. Motion Signals — Simulated anticipation packets
2. Gesture Classification — Rule-based pattern matching
3. Intent Inference — Grammar-based sequence matching
Dependencies
# Core
pip install numpy matplotlib scikit-learn
# Optional (for enhanced visualizations)
pip install umap-learn seabornIntegration with Comp-Core
These examples use simulated data for demonstration. For real integration:
Using cc-anticipation (Python bindings)
from cc_anticipation import AnticipationKernel, AnticipationConfig, MotionWindow
# Create kernel
config = AnticipationConfig.default()
kernel = AnticipationKernel(config)
# Process real motion data
window = MotionWindow.from_frames(skeleton_frames)
packet = kernel.process(window)
# Use packet in our examples
from intent_classification import GestureClassifier
classifier = GestureClassifier()
gesture = classifier.process(packet)Using cc-gesture (Rust)
use cc_gesture::{GestureClassifier, AnticipationData, NeighborMatch};
// Create classifier
let mut classifier = GestureClassifier::default_config();
// Classify from real anticipation data
let data = AnticipationData::new(
packet.commitment,
packet.uncertainty,
packet.transition_pressure,
packet.regime_embedding.to_vec()
);
if let Some(gesture) = classifier.classify(&data, &neighbors) {
println!("Detected: {}", gesture.label.name);
}File Structure
examples/
├── README.md # This file
├── latent_trajectory_viz.py # Trajectory visualization
├── gesture_clustering.py # Clustering analysis
└── intent_classification.py # Full pipeline demoReferences
- [MOTION_SEMANTICS.md](../MOTION_SEMANTICS.md) — Theoretical framework
- [GESTURE_LEXICON.md](../GESTURE_LEXICON.md) — Gesture catalog
- [cc-anticipation](../../../core/motion/cc-anticipation/) — Rust anticipation kernel
- [cc-gesture](../../../core/motion/cc-gesture/) — Rust gesture classifier
Promotion Decision
Attach run IDs, datasets, metrics, and reproduction commands.
Source Anchor
Comp-Core/docs/motion-language/examples/README.md
Detected Structure
Method · Evaluation · References · Figures · Code Anchors · Architecture