Skip to content

v0.9.0 — Dataset decision layer & annotate mode

Choose a tag to compare

@omertt27 omertt27 released this 03 Sep 17:41
· 110 commits to main since this release

[0.9.0] — Dataset decision layer & annotate mode

ADR-011: calibra prune no longer only removes episodes. It can now emit a
per-episode decision layer — every episode gets a disposition
(KEEP / DROP / ANNOTATE / …) and a characterization (quality_risk,
coverage_value, anomaly_score, calibra_score, redundancy, …) — and
annotate mode writes that as a training-ready, model-agnostic sidecar so a
metadata-conditioned policy can use data that aggressive pruning would drop.
The existing calibra prune coreset workflow is unchanged. See
docs/adr/adr-011-dataset-decision-layer.md and docs/annotate.md; the
research gate (does the metadata actually improve training?) is
experiments/METADATA_CONDITIONING_BENCHMARK.md.

Added

  • Dataset decision layer (ADR-011), schema groundwork. CurationReport now carries a dispositions list — one EpisodeCharacterization per episode holding its decision (new Disposition enum: KEEP / DROP / DOWNWEIGHT / ANNOTATE / REVIEW / RECOLLECT) plus the signals behind it (n_steps, quality_risk, coverage_value, anomaly_score, integrity_flags, reasons, …). The legacy retained_indices / dropped_indices are unchanged and now derived from dispositions (KEEP / DOWNWEIGHT / ANNOTATE → retained) when only one side is supplied, so existing callers keep working. EpisodeCurator.curate() populates dispositions (threshold pass → KEEP, threshold failure → DROP). New CurationReport.by_disposition() / disposition_counts().
  • calibra prune --annotate DIR — annotate mode (ADR-011): instead of only removing episodes, write a training-ready sidecar that keeps every episode with a decision and characterization attached. calibra_annotations.jsonl has one row per episode — calibra_disposition (KEEP / DROP / ANNOTATE) plus calibra_score, quality_risk, coverage_value, anomaly_score, redundancy, success, n_steps, integrity_flags, weight — alongside calibra_annotations.manifest.json (versioned schema + a field dictionary, so the sidecar is self-describing) and the raw calibra_curation_report.json. Redundant episodes (ones vanilla pruning would drop) are marked ANNOTATE: keep them if your trainer conditions on the metadata. --annotate-format {jsonl,parquet,both} (default jsonl) additionally writes calibra_annotations.parquet (columnar, explicit typed schema; needs pyarrow). The schema is model-agnostic; ACT / Diffusion / VLA conditioning recipes live in docs/annotate.md. New: calibra.schema.annotations (AnnotationManifest, EpisodeAnnotation), calibra.annotate.write_annotations().
  • Decision-layer characterization — EpisodeCharacterization (on CurationReport.dispositions) now carries calibra_score (100·(1 − quality_risk)), quality_risk, anomaly_score, coverage_value, redundancy (1 − coverage_value) and success, not just the triggering threshold. New helpers calibra.assessment.episode_calibra_score() / episode_redundancy(). calibra.pruning.pruning_result_to_curation_report(result, batch, *, report=None, redundant_disposition=DROP) maps a prune run to the decision-layer schema — pass the DiagnosticReport to fill the assessment axes, and DOWNWEIGHT / ANNOTATE to retain redundant episodes instead of dropping them — and is also reachable as PruningResult.to_curation_report(batch, ...), so CoresetSelector and EpisodeCurator expose the same CurationReport view. EpisodeCurator.curate() populates the same enriched characterization.
  • calibra experiment record --from-metrics PATH — reads GPU-hours / wall-clock / eval success / loss / energy straight out of a finished run's metrics file (flat JSON, or a Weights & Biases wandb-summary.json from an offline run) instead of retyping them. Point it at a file or a run directory. A built-in alias table matches common key names; --map FIELD=path.to.key (repeatable) handles anything unusual. An explicit flag always overrides the file. gpu_hours is only taken when literally present — never derived from wall-clock — so a derived figure can't be mistaken for a measured one by the benchmark classifier. The provenance string is stored on the record as metrics_source. New module calibra/metrics_ingest.py. No network access.
  • calibra experiment record --from-review PATH — folds a calibra review --json file's per-episode assessments into the record's mean_anomaly_score / mean_quality_risk / mean_coverage_value, capturing the dataset side and the training-outcome side of an experiment in one command. Rejects a partial review queue rather than logging a biased dataset-level mean.
  • calibra experiment record --dry-run — parse --from-metrics / --from-review and print what would be recorded, writing nothing.
  • calibra experiment record — metadata-conditioning benchmark fields. New --arm (label in the A/B/C/D/R/R+ matrix), --metadata-conditioning (was the policy conditioned on the annotate-mode sidecar?), and --actual-retention PCT (fraction of the original dataset actually trained on — diverges from --retention, the nominal prune target, for the KEEP∪ANNOTATE arm where rescued episodes raise effective retention). ExperimentRecord gains arm, metadata_conditioning, actual_retention_pct; old rows default them. calibra experiment list shows arm=… +meta and (actual N%). Supports experiments/METADATA_CONDITIONING_BENCHMARK.md.

Fixed

  • Annotate mode verified against real data. tests/test_annotate_integration.py (marked integration) runs calibra prune --annotate end-to-end against lerobot/pusht (206 episodes, v2 Parquet) and asserts sidecar/dataset episode alignment, disposition partitioning, DROP rows carrying integrity flags, populated non-degenerate characterization columns, ANNOTATE < KEEP mean coverage (rescue semantics), JSONL == Parquet == load() round-trip, and that the coreset output is unchanged by --annotate.
  • anomaly_score no longer saturates at 1.0 for every episode on small datasets. calibra.assessment.compute_episode_assessments took the max percentile-rank extremity across all ~9 per-episode metrics; with few episodes relative to the metric count, nearly every episode is the batch min or max on some metric, so the score collapsed to ~1.0 for the whole batch (visible in calibra review and the annotate-mode sidecar). A metric now counts toward anomaly_score only when the episode is BOTH in that metric's rank tail (p≤0.1 or p≥0.9) AND ≥2.5 robust-MAD deviations from the batch median — i.e. being last in a tight cluster is not an anomaly, being a genuine magnitude outlier is. On a 12-episode dataset with two jerk-spike episodes, anomaly_score is now 1.0 for exactly those two and 0.0 for the rest (was 1.0 for all twelve). The reason list is unchanged. The signal is still weak below ~100 episodes and is documented as such.