jepa_world/lib.rs
1//! # jepa-world
2//!
3//! World model primitives for JEPA-based planning and control.
4//!
5//! This crate bridges the gap between learned representations (from
6//! [`jepa_core`] / `jepa-vision`) and decision-making. It provides:
7//!
8//! - **Action-conditioned dynamics** — predict next-state representations
9//! given an action, enabling model-based rollout (RFC-009).
10//! - **Hierarchical JEPA (H-JEPA)** — stack multiple JEPA levels at
11//! different temporal/spatial scales (RFC-010).
12//! - **Short-term memory** — bounded FIFO buffer of recent states for
13//! multi-step planning context.
14//! - **Planning** — [`RandomShootingPlanner`] (CEM) evaluates candidate
15//! action sequences against a learned world model and cost function.
16//!
17//! ```text
18//! ┌───────────────┐
19//! observation ────►│ Encoder │──► s_t
20//! └───────────────┘ │
21//! ▼
22//! ┌───────────────┐ ┌──────────────────────┐
23//! a_t ───►│ Dynamics │──►│ s_{t+1} ... s_{t+H} │──► CostFunction ──► plan
24//! │ (World Model)│ └──────────────────────┘
25//! └───────────────┘
26//! ```
27//!
28//! ## Modules
29//!
30//! | Module | Contents |
31//! |--------|----------|
32//! | [`action`] | [`Action`] wrapper, [`ActionConditionedPredictor`] trait |
33//! | [`planner`] | [`WorldModel`], [`RandomShootingPlanner`] (CEM), [`CostFunction`] trait, [`L2Cost`] |
34//! | [`hierarchy`] | [`HierarchicalJepa`], [`JepaLevel`] — multi-scale H-JEPA |
35//! | [`memory`] | [`ShortTermMemory`] — bounded ring buffer of recent states |
36
37pub mod action;
38pub mod hierarchy;
39pub mod memory;
40pub mod planner;
41
42pub use action::{Action, ActionConditionedPredictor};
43pub use hierarchy::{HierarchicalJepa, HierarchyError, JepaLevel};
44pub use memory::{MemoryError, ShortTermMemory};
45pub use planner::{
46 CostFunction, L2Cost, PlanResult, PlanningError, RandomShootingConfig, RandomShootingPlanner,
47 WorldModel,
48};