Commit Graph

20 Commits

Author SHA1 Message Date
hexone2086 479c2b1488 refactor: strided conv encoder with 80x60 input resolution
- CNNEncoder: stride=2 convs replace Conv2d+MaxPool2d pattern
- 3 layers (32,64,128) instead of 4 (32,64,128,256), GRU input 192
- DecodeSample resizes grayscale frames to 80x60 via INTER_AREA
- Model params: 227K (was 1.5M), input 80x60 (was 320x240)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-01 17:47:45 +08:00
hexone2086 a97b4da1ad fix: persist and restore event threshold via checkpoint
Save event_threshold to checkpoint dict during training, restore it
during resume and evaluation. evaluate.py now reads from checkpoint
instead of hardcoding train_cfg default, so evaluation matches the
threshold used during training.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-01 17:47:39 +08:00
hexone2086 ce70d932d3 docs: strip AGENTS.md to harness essentials, remove research detail
- Remove model architecture, I/O spec, pipeline, training config
- Remove benchmark commands (dir deleted), outdated CNN-disabled note
- Remove visualization detail, key conventions, known issues
- TEST_SCENES: swap indoor_forward_9 for outdoor_forward_1
- model.py: drop stale commented zero-out line

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-08-01 17:11:17 +08:00
hexone2086 134bd2c3dc refactor: stateless training with randomized seq_len per epoch
- stateless: each batch starts from zero GRU hidden state
- curriculum: random seq_len from [64,96,128,160,192] per epoch
- val fixed at seq_len=128 for consistent cross-epoch comparison
- remove 256 from choices (OOM at B=4 on 24GB VRAM)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-29 17:21:37 +08:00
hexone2086 cc5dedc3fe fix: remove denormalization in eval scripts
NormalizeVelocity transform is disabled, so model outputs are already in
original m/s space. Denormalizing inflates RMSE by ~3.5x.

- evaluate.py: compute RMSE in model output space directly
- benchmark/evaluate.py: same, plus fix misleading "normalized" comment

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-29 16:59:01 +08:00
hexone2086 d1d3310543 feat: add TBPTT training with cross-batch hidden state carryover
- config: seq_len=128, batch_size=4 for long-sequence TBPTT
- dataset: create_tbptt_loader with non-overlapping windows, strict temporal order
- model: forward() accepts/exposes hidden state h; add step() for single-frame stateful inference
- train: carry detached hidden state across batches, reset at epoch boundary
- benchmark: fix model call for new (v_body, h) return signature

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-29 16:32:41 +08:00
hexone2086 5ccd3df874 docs: add TODO.md
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-09 15:50:25 +08:00
hexone2086 56aa10a503 feat: per-step supervision over full sequence
- model outputs (B, S, 2) instead of (B, 2) — GRU output at every timestep
- train/val loss computed over all S timesteps with reduction=none
- benchmark/evaluate.py takes pred[:, -1, :] for final-step evaluation
- added per-step loss logging (8 evenly spaced steps) to TensorBoard

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-07-09 15:49:23 +08:00
hexone2086 504332190d feat: add stateful evaluation with model.step() for per-frame GRU inference
- Add VelocityPredictionModel.step() for single-frame forward pass
  with external GRU hidden state management
- Add evaluate_stateful() that processes frames sequentially,
  maintaining hidden state across timesteps (seq_len=1, stride=1, batch=1)
- Evaluation uses strict temporal ordering (num_workers=0)

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-21 20:58:57 +08:00
hexone2086 b0942180ba feat: add --threshold CLI arg for event brightness override; move ckpt_dir under run_id subdirectory
- --threshold CLI arg overrides config event_threshold at runtime
- Move ckpt_dir creation after run_id resolution (run-specific subdirectory)
- Use overridden threshold in train/val loader creation

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-21 20:32:01 +08:00
hexone2086 02d429282e feat: add --show-events overlay with raw log intensity
Visualize raw temporal brightness change (threshold=0, log domain)
as green(+)/red(-) gradient overlay proportional to |change|.
Supports video output and live display modes.
Enables EventProcessor threshold=0 for raw mode without clipping.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-08 11:47:19 +08:00
hexone2086 1369edaad7 feat: enable BatchNorm2d in CNNEncoder and add AMP support
- Uncomment BatchNorm2d in CNNEncoder (activated when cfg.use_bn=True)
- Add torch.amp.GradScaler + autocast for mixed precision training
- Add --amp/--no-amp CLI argument (default: enabled)

Generated by Mistral Vibe. deepseek-v4-flash
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-08 00:41:34 +08:00
hexone2086 b5abbc239d feat: activate CNN encoder, enable head near-zero init, disable NormalizeVelocity
- Activate CNNEncoder forward (replace zero placeholder with actual inference)
- Enable near-zero weight init for head final layer (weight*=0.01, bias=0)
- Disable NormalizeVelocity transform to train on raw velocity scale
- (BatchNorm remains commented out)

Generated by deepseek-v4-flash.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-06 14:04:40 +08:00
hexone2086 e7e773a48f fix: evaluate each scene independently to avoid plot mixing
Multi-scene evaluation previously concatenated all scenes into one
continuous trace, causing scene boundary jumps to appear as glitches
in plots. Now evaluates each scene separately and inserts NaN
separators between scenes when concatenating for plotting.

Generated by Mistral Vibe (deepseek-v4-flash).
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 16:47:42 +08:00
hexone2086 cb9936542e feat: replace non-overlapping windows with sliding-window sequence sampling
- Remove sample-level shuffle before transforms (broke SimulateEvents)
- Add _sliding_window_fn: yields overlapping sequences with configurable stride
- Add sequence-level shuffle after grouping (preserves temporal coherence)
- Add sliding_window_stride to TrainConfig (stride=1 for full overlap)
- Update create_train/val_loader and train.py to pass stride
- AGENTS.md: document known issues (cross-shard boundary, SimulateEvents state)
- AGENTS.md: add cuda:7 device preference

Generated by Mistral Vibe (deepseek-v4-flash).
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-05 16:45:24 +08:00
hexone2086 ec143868d0 feat: add checkpoint resume and fix train_loss tracking
- Add --resume CLI arg to resume training from a checkpoint
- Restore model, optimizer, scheduler state; continue from saved epoch+1
- Preserve global_step and best_val_loss across resume
- Save run_id in checkpoints for TensorBoard log continuity
- Use logs/run_<timestamp>/ subdirectories to isolate experiment logs
- Fix: replace train_loss in checkpoint dict with global_step to avoid
  KeyError when loading; track global_step through train_one_epoch
- Fix: use global_step (not batch_idx) as TensorBoard x-axis for batch loss
- Fix: print average loss at end of each epoch

Generated by Mistral Vibe (ds-v4-flash).
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 22:55:31 +08:00
hexone2086 0a504d648e refactor: replace rotation vector with body up vector for tilt input
- Replace body_attitude() with body_up_vector(): rotate world-up [0,0,1]
  by corrected world→body quaternion to get body up vector (pitch/roll only,
  no yaw). Matches DiffPhysDrone's env.R[:, 2] approach.
- Update ComputeTilt transform to use body_up_vector_np
- Update visualize_dataset.py to display Euler angles and body up vector
- Update model.py comments and disable CNN (zero output)
- Sync AGENTS.md with new architecture description

Generated by Mistral Vibe (ds-v4-flash).
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 21:02:08 +08:00
hexone2086 8e1a98207e refactor: replace decompose_tilt with body_attitude, add quat_to_euler
- Add body_attitude() that applies R_odom_to_body calibration then
  converts directly to rotation vector (preserves yaw, unlike old
  decompose_tilt which stripped it)
- Add quat_to_euler() for visualization display
- Update ComputeTilt transform to use body_attitude_np (also fixes
  a bug where the old code omitted the static calibration)
- Update visualize_dataset.py to show Euler angles from body quaternion
  instead of yaw-stripped tilt rotation vector

This aligns with the DiffPhysDrone approach: let the model decide
whether to use yaw information, rather than removing it upfront.

Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 20:38:14 +08:00
hexone2086 e0184a6e14 fix: make start_ros_container.sh executable
Generated by Mistral Vibe.
Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
2026-06-04 20:37:58 +08:00
hexone2086 9f0321eff8 initial commit 2026-05-29 18:49:01 +08:00