Control v2 Cleanup - #313
Conversation
| Controlled simulation currently supports one trajectory at a time. Its online | ||
| filter update is implemented with Cuthbert and supports `KFConfig`, `EKFConfig`, | ||
| `EnKFConfig`, and `PFConfig`. `dsx.plate` and `n_simulations > 1` are rejected | ||
| explicitly. Controlled simulation requires `filter_source="cuthbert"` and |
There was a problem hiding this comment.
Regarding this, I added a draft PR #314 to illustrate some of the issues and limitations with using the CD-dynamax backend. Not a serious proposal, more of an illustration of some of current limitations
There was a problem hiding this comment.
thanks! Another way to deal with that is to update CD-Dynamax to expose lower-level predict/update steps.
And then integrate them into a unifying mid-level Dynestyx Filter object (#295 )
There was a problem hiding this comment.
I think that's the correct approach, it probably would be useful for other projects as well. I can take a look at it soonish.
There was a problem hiding this comment.
I wouldn't prioritize the CD-Dynamax side too heavily, because once #299 lands (better discretizers), we will be able to use those w/ Cuthbert filters to get most of the CD-Dynamax features.
But indeed, setting up #295 will be generally very useful for many other projects---I think a great direction to get us up to cutting-edge would be to implement/learn "enhanced filters" this way.
| - Quick Example L63: quick_example.ipynb | ||
| - SDEs with Non-Gaussian Observations: tutorials/sde_non_gaussian_observations.ipynb | ||
| - Closed-loop Control: | ||
| - Controller basics: tutorials/control/controller_demo.ipynb |
There was a problem hiding this comment.
Could it be worth it to add the basic tutorial into the gentle introduction?
There was a problem hiding this comment.
Let's make that a separate PR so we can have a chance to look more carefully at the "pedagogy" and make sure it is as simple and clear as possible?
There was a problem hiding this comment.
Sounds good! I think it would be very nice to have a basic example of online control in the intro tutorial
DanWaxman
left a comment
There was a problem hiding this comment.
looks mostly there to me, a few small nits
|
|
||
| `u` is the control that drove the transition into the state being filtered: | ||
| $u_k$ for the transition from $x_k$ to $x_{k+1}$ and observation | ||
| $y_{k+1}$. For a bootstrap update (`prev_state=None`), `t_prev` must still |
There was a problem hiding this comment.
sorry what is bootstrapping here?
There was a problem hiding this comment.
I think it is just how to start with prev_state=None; this was @MatthieuDarcy 's wording, perhaps through Claude haha. I had codex re-word this stuff...
@MatthieuDarcy could you double check its explanation? my brain is a bit split
f2da094 to
3ae942a
Compare
3ae942a to
e6bf79d
Compare
Summary
This PR hardens and cleans up the closed-loop control implementation introduced in
control_v2. It clarifies simulator contracts and current limitations, fixes online-filter initialization and randomness handling, improves typing and documentation, and adds focused coverage without changing the MPPI algorithm.(heavy use of codex, but reviewed and iterated most things and culled a lot of the big changes it made to code + docs)
Key changes relative to
control_v2filter_source="cuthbert"and raises a clear error for unsupported backends.filter_config.crn_seed.initial_policy_statean explicitSimulator.simulateargument.ctrl_timesandctrl_valueswhen controls are computed online.n_simulations > 1also remains unsupported.dsx.simulaterollout semantics unchanged, while correcting inaccurate documentation about its formulation, differentiable fields, anddtdefault.