Skip to content

Bounded bilevel optimizer

vertax.bilevelopt.boundedbop

The settings and most methods are inherited from _BilevelOptimizer, documented on its own page.

Bilevel optimizer for bounded meshes.

BoundedBilevelOptimizer

BoundedBilevelOptimizer()

Bases: _BilevelOptimizer

Bi-level optimizer for bounded meshes (BoundedMesh).

Create a Bi-level optimizer for bounded meshes with default parameters.

Does not set the inner and outer loss functions yet.

t1_tension_reset instance-attribute

t1_tension_reset: T1TensionReset | None = None

Reset the line tension of every edge a T1 creates to the mean tension of its kind, in every relaxation (inner optimization and the estimators' own). Off (None) by default; see T1TensionReset. With it, inner_optimization stores the post-reset parameters in the mesh, and outer_optimization applies its update to the post-reset parameters of the estimator's relaxation.

last_t1_resets instance-attribute

last_t1_resets: T1ResetReport | None = None

With t1_tension_reset, what the last inner or outer optimization did to the tensions: the post-reset parameters, the transitions accepted on each edge in each relaxation, and, for EP, the number of edges on which its two solves disagree. None without the option.

compute_outer_loss

compute_outer_loss(mesh: Mesh, only_on_vertices: None | list[int] = None, only_on_edges: None | list[int] = None, only_on_faces: None | list[int] = None) -> float

Get the result of self.loss_function_outer called with the correct arguments.

Must be implemented by child classes.

compute_inner_loss

compute_inner_loss(mesh: Mesh, only_on_vertices: None | list[int] = None, only_on_edges: None | list[int] = None, only_on_faces: None | list[int] = None) -> float

Get the result of self.loss_function_inner called with the correct arguments.

Must be implemented by child classes.