SolverTemplate#

class SolverTemplate[source]#

Template for solvers for the Operator Inference regression \(\Z \approx \Ohat\D\trp\) (or \(\D\Ohat\trp \approx \Z\trp\)) for the operator matrix \(\Ohat\).

Child classes formulate the regression, which may include regularization terms and/or optimization constraints. Hyperparameters should be set in the constructor (regularization terms, etc.).

Properties:
d#

Number of unknowns in each row of the operator matrix (number of columns of \(\D\) and \(\Ohat\)).

data_matrix#

\(k \times d\) data matrix \(\D\).

k#

Number of equations in the least-squares problem (number of rows of \(\D\) and number of columns of \(\Z\)).

lhs_matrix#

\(r \times k\) left-hand side data \(\Z\).

r#

Number of operator matrix rows to learn (number of rows of \(\Z\) and \(\Ohat\))

Methods:

cond

Compute the \(2\)-norm condition number of the data matrix \(\D\).

copy

Make a copy of the solver.

fit

Verify dimensions and save the data matrices.

load

Load a serialized solver from an HDF5 file, created previously from the save() method.

residual

Compute the residual of the \(2\)-norm regression objective for each row of the given operator matrix.

save

Serialize the solver, saving it in HDF5 format.

solve

Solve the Operator Inference regression.

verify

Verify the solver.