FLOG Binary Format and Analysis Dashboard
FLOG (Flocke LOG) is a compact binary format for recording training data. It stores physics state, training statistics, and events in a single file that can be analyzed post-hoc or monitored live during training.
Binary Format
Header: 4 bytes: magic "FLOG" 2 bytes: version (uint16 LE) 1 byte: phase (uint8) 4 bytes: meta_length (uint32 LE) N bytes: JSON metadata (creature, task, scene, etc.) Frames (repeated): 8 bytes: timestamp (float64 LE) 1 byte: frame_type (uint8) 4 bytes: data_length (uint32 LE) N bytes: msgpack payload Frame Types: 1 = Evolution 2 = Training Stats (every 1000 steps) 3 = Event (milestones, errors) 4 = Creature (every 10 steps: pos, vel, ball_pos, heading, speed)
Dashboard
The FLOG Analysis Dashboard is a standalone web UI that visualizes training data:
python flog_server.py # Start server on port 5050 # Open http://localhost:5050
No MuJoCo required — the dashboard only reads FLOG files.
Charts
- Ball Distance — Full-width hero chart showing ball distance over training, with 1.0m and 0.5m threshold lines
- SNN Actor vs CPG — Actor competence (green) vs CPG weight (orange), showing the SNN takeover
- Task PE & Reward — Learning signal visualization: reward (cyan), task PE (red), prediction error (violet)
- Cerebellum — PF→PkC weight, correction magnitude, GrC sparseness
- Stability & Speed — Upright (0-1) and velocity over time
- Behavior Timeline — Color-coded strip showing active behavior (walk, trot, chase, sniff, play, alert)
Python Reader
from src.viz.flog_replay import FlogReplay
replay = FlogReplay('creatures/go2/v034_.../training_log.bin')
print(f"Creature: {replay.creature}, Task: {replay.task}")
print(f"Duration: {replay.duration_s:.1f}s, Frames: {replay.total_frames}")
for frame in replay.stats_frames():
print(f"Step {frame['step']}: dist={frame['distance']:.2f}m")
Server API
GET /api/flog/list— Discover all FLOG filesGET /api/flog/analyze?path=...— Full analysis (all stats, events, physics summary)GET /api/flog/watch?path=...&since=N— Incremental reading for live monitoring
References
- MessagePack specification: msgpack.org
- MuJoCo documentation: mujoco.readthedocs.io
API Reference
TrainingRecorder (creature_store.py)
Binary FLOG writer. Used by train_v032.py.
__init__(path, creature_name, task, phase, metadata)
Creates FLOG file with header (magic + version + phase + JSON metadata).
record_creature_frame(timestamp, data: dict)
Write type-4 frame. Keys: pos, ball_pos, step, vel, heading, speed. Msgpack encoded. Called every 10 steps.
record_stats_frame(timestamp, stats: dict)
Write type-2 frame. All training stats. Called every 1000 steps.
record_event(timestamp, event_type, data)
Write type-3 frame. Milestones, curriculum changes, falls.
FlogReplay (flog_replay.py)
Binary FLOG reader for post-hoc analysis.
__init__(path)
Parse FLOG header and index all frames.
stats_frames() → generator
Yield all type-2 stats frames as dicts.
creature_frames() → generator
Yield all type-4 creature frames as dicts.
flog_server.py — REST API
GET /api/flog/list List all FLOG files GET /api/flog/analyze?path=... Full analysis GET /api/flog/watch?path=...&since=N Incremental read (live) GET /api/flog/watch/reset Reset watch offset
FLOG Binary Format
Header: 4B magic "FLOG" + 2B version + 1B phase + 4B meta_len + JSON Frame: 8B timestamp(f64) + 1B type(u8) + 4B data_len(u32) + msgpack Types: 1=Evolution 2=Stats 3=Event 4=Creature