Open acse-yw11823 opened 1 week ago
There are so many layers involved in the code that is not really practical as a reproducer. Below should be enough as a reproducer:
import ROL
from firedrake import *
paramsDict = {
"General": {"Secant": {"Type": "Limited-Memory BFGS", "Maximum Storage": 10}},
"Step": {
"Type": "Augmented Lagrangian",
"Augmented Lagrangian": {
"Subproblem Step Type": "Line Search",
"Subproblem Iteration Limit": 5,
},
"Line Search": {"Descent Method": {"Type": "Quasi-Newton Step"}},
},
"Status Test": {
"Gradient Tolerance": 1e-15,
"Iteration Limit": 100,
"Step Tolerance": 1e-15,
},
}
params = ROL.ParameterList(paramsDict, "Parameters")
algo = ROL.Algorithm("Line Search", params)
So the two inputs to ROL.Algorithm are arg0: ROL::Step<double>, arg1: _ROL.StatusTest
. So both of the arguments you are passing in are not the correct type.
The fact is, although ROL.Algorithm
is an interface for the general roltrilinos algorithms class, but is only implemented by @angus-g to provide access to a few optimisation methods that have not been previously accessible within ROL2.0, like Lin-More, which seems to be the one optimisation method that rol's developers have focused on for their large-scale problems in recent years.
My suggestion is that either you follow the few demos that are available in pyadjoint/firedrake repositories that are generally based on the old ROL routines (pyROL2.0 is backward compatible) or if you want to take advantage of the new implementations, look at our test cases or demos in gadopt: https://github.com/g-adopt/g-adopt/blob/master/tests/optimisation_checkpointing/helmholtz.py
Hello. I am currently using Mac M1. And running the following code. It shows the error from the pybind11?
Does anyone have a hint about solving it?
Her is my code:
ROL.Algorithm("Line Search", params)
. Does anyone know why"Line search"
be recognised as string instead of ROL::StepAnd this is the error:
Many thanks