Skip to content

Add model_slice to objective funcs to handle composed models#74

Draft
santisoler wants to merge 55 commits intomainfrom
model-wiring-matrix-slicer
Draft

Add model_slice to objective funcs to handle composed models#74
santisoler wants to merge 55 commits intomainfrom
model-wiring-matrix-slicer

Conversation

@santisoler
Copy link
Copy Markdown
Member

Handle composed models (with multiple physical properties) with Wires and ModelSlice objects.

@santisoler santisoler changed the title Add a model_slice argument to objective funcs to handle composed models Add model_slice to objective funcs to handle composed models Feb 6, 2026
Add a class to represent an extended hessian matrix in objective
functions.
Ditch the _slice_matrix property and make use of the ModelSlice expand
methods to expand the gradient and the hessian.
Use the decorator in the DataMisfit and the mesh-based regularizations.
@santisoler santisoler force-pushed the model-wiring-matrix-slicer branch from 6376404 to d500b1c Compare February 11, 2026 23:47
@santisoler
Copy link
Copy Markdown
Member Author

TODO:

  • After merging this PR, I should open an issue regarding hessian_approx and its support for model slicer. We always want hessian_approx to return a dense/sparse matrix, not a linear operator. The decorator will return a BlockMatrix when extending it. I think we might want to add an option to the decorator to extend matrices in full form.
    • Dense matrix -> dense matrix
    • Sparse diagonal -> sparse diagonal (shouldn't be hard to extend).

…nal`

They call other methods that already implement the reduction of the
model.
Edit the decorator so it doesn't reduce the model nor expand the output
of the method if the model is already reduced.
Add optional arguments to enable or disable reduction of the model and
expansion of the return. Update some methods in `DataMisfit` to make use
of the new features. For example, the `residual` method now is
configured to reduce the model, but not expand its output.
Restore decorator to `hessian_approx` and `hessian_diagonal` methods in
the `DataMisfit`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant