Skip to content

Conversation

nicolearetz
Copy link
Contributor

Made changes to method_of_snapshots:

  • For some non-Euclidean inner products, the computed reduced spaces weren't orthonormal (the multiplication of the states with the eigenvalues and eigenvectors is too sensitive to errors). Fixed it through additional Gram-Schmidt steps.
  • Found an error where the computed reduced space would have shape (n, r) with r > n. This would lead to issues with the orthonormality check. Fixed it so that at most n eigenvalues are treated as non-zero (which is how many there should be at most anyway)

Made changes to PolynomialOperator:

  • Added parametric version
  • changed the computation of the condensed Kronecker product so that it doesn't compute the whole Kronecker product first. This speeds-up the ROM computation time a lot.

Made changes to models (mono):

  • Added the possibility to specify an initial guess to the fit function. The regularized OpInf problem is then regularized towards the initial guess instead of zero.
  • added tests

Copy link
Member

@shanemcq18 shanemcq18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think initial_guess needs to be part of the solver, not the model, or the ROM class won't see it.


if sum(positives) > states.shape[0]:
print(eigvals)
print(positives)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we get rid of these print() calls? Or do we want to keep them?

index = endex

def _fit_solver(self, states, lhs, inputs=None):
def _fit_solver(self, states, lhs, inputs=None, initial_guess=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the initial_guess be part of the solver instead of the model? So, something like this:

rom = opinf.ROM(
    model = opinf.models.ContinuousModel(
        operators="AB",
        solver=opinf.lstsq.L2Solver(reg, initial_guess=something),
    )
)

I think it should be this because the initial guess is only used for Tikhonov-type solvers, right? Doing it this way would also play nicely with the ROM class, otherwise you can't specify the initial_guess unless you are calling the model's fit() method directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants