Mpc#
Short-Horizon MPC Optimizer#
Model-Predictive Control (MPC) over a short horizon. Optimizes control-like parameters (e.g., alpha) by rolling out a few steps ahead, minimizing the cumulative cost with a small action penalty. Uses simple projected gradient descent over the horizon (can be swapped for a QP solver later).
- Interface:
initialize(params) -> state
step_params(model, params, context) -> (new_params, state)
- Context:
context[“rollout_fn”](model, params, horizon, context) -> (traj_info, cum_loss) where cum_loss already aggregates Task + Cons + Coh + action_penalty.
“horizon”: int, number of predictive steps (default 3)
Optional: “project_fn”(params) to project back to feasible set.