This repo scaffolds a PyTorch project for a transformer-based foundation model
over event camera data. See DESIGN.md for the design draft.
src/ecfm: library codeconfigs: YAML configsscripts: training and utility entrypointsdata: placeholder for datasetstests: basic unit testsdocs: extra docs
- Create a venv and install dependencies.
- Run a dry training loop with synthetic events.
python -m venv .venv
.venv\Scripts\Activate.ps1
pip install -e .
python scripts\train.py --config configs\small.yamlIf your default Python is 3.14, install a CUDA-enabled PyTorch build in a Python 3.12 venv (CUDA wheels are not available for 3.14).
py -3.12 -m venv .venv312
. .\.venv312\Scripts\Activate.ps1
python -m pip install --upgrade pip
pip install --upgrade --force-reinstall torch torchvision --index-url https://download.pytorch.org/whl/cu121
pip install -e .
python -c "import torch; print(torch.__version__, torch.cuda.is_available(), torch.cuda.get_device_name(0))"If the dataset is placed at datasets/THU-EACT-50-CHL, run:
python scripts\train.py --config configs\thu_smoke.yamlConvert a name-sorted slice of an image folder to MP4 or GIF:
python scripts\images_to_media.py --image-dir outputs\frames --output outputs\clip.mp4 --start-index 100 --frame-count 300 --fps 30
python scripts\images_to_media.py --image-dir outputs\frames --output outputs\clip.gif --start-index 100 --frame-count 90 --fps 12Generate expanded YAML configs, a manifest, and run_all.ps1/run_all.sh
from a base config plus a grid spec:
python scripts\generate_config_sweep.py --base-config experiments\kalman_ml_forecasting\configs\base.yaml --spec experiments\kalman_ml_forecasting\configs\sweep_example.yaml --output-dir outputs\kalman_ml_sweeps\exampleThe spec supports grid, static overrides, output path templates, and a
launcher command using {config}. Generated sweep configs include
train.log_file: "{output_dir}/runs/{name}/train.log" by default unless the
spec overrides that template.
After runs finish, collect configs and results into table-ready records:
python scripts\sweep_results.py --sweep-dir outputs\kalman_ml_sweeps\example --output-csv outputs\kalman_ml_sweeps\example\results.csvFrom Python:
from pathlib import Path
from scripts.sweep_results import sweep_dataframe, load_sweep_runs
df = sweep_dataframe(sweep_dir=Path("outputs/kalman_ml_sweeps/example"))
print(df[["name", "test.loss", "test.fde_center_px", "config.data.representations"]])
runs = load_sweep_runs(sweep_dir=Path("outputs/kalman_ml_sweeps/example"))
print(runs[0].config)
print(runs[0].test_results)