-
Notifications
You must be signed in to change notification settings - Fork 32
Regularization towards initial guess #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
regularization
There was a problem hiding this 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) |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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.
Made changes to
method_of_snapshots
:Made changes to
PolynomialOperator
:Made changes to
models
(mono):initial guess
to thefit
function. The regularized OpInf problem is then regularized towards the initial guess instead of zero.