Optional
initial_trust_region_radius| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Initial trust region radius (distance in model norm). |
initial_trust_region_linf is applied pointwise
for all model parameters, while initial_trust_region_radius
measures distance in the model norm. If both parameters are
provided, the more restrictive condition is used.class TrustRegion(salvus.flow.utils.serialization_helpers.SerializationMixin):
def __init__(
self,
initial_trust_region_radius: salvus._core.types.float_ | None = None,
initial_trust_region_linf: (
salvus._core.types.float_ | typing.Callable | str | None
) = None,
max_lbfgs_history: salvus._core.types.int_ = 10,
max_lbfgs_radius: salvus._core.types.float_ | None = None,
min_model_update_norm: salvus._core.types.float_ = 0.0,
max_trial_models_per_iteration: salvus._core.types.int_ | None = None,
fail_if_max_trial_models_reached: bool = True,
convergence_criteria: dict | None = None,
use_event_dependent_gradients: (
bool | typing.Literal["auto-detect"]
) = "auto-detect",
use_preconditioner: bool | None = True,
tr_eta_1: salvus._core.types.float_ = 0.001,
tr_eta_2: salvus._core.types.float_ = 0.5,
tr_gamma_1: salvus._core.types.float_ = 0.5,
tr_gamma_2: salvus._core.types.float_ = 0.9,
tr_sigma: salvus._core.types.float_ = 2.0,
): ...| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Initial trust region radius (distance in model norm). |
| Type: | salvus._core.types.float_ | typing.Callable | str | None |
| Default value: | None |
| Description: | Initial trust region radius (distance in L-infty norm). Either a float or a callback function (intended only for expert users). |
| Type: | salvus._core.types.int_ |
| Default value: | 10 |
| Description: | Maximum history of L-BFGS approximation. |
| Type: | salvus._core.types.float_ | None |
| Default value: | None |
| Description: | Maximum radius (in model space norm) of models considered in L-BFGS approximation. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.0 |
| Description: | Threshold on the norm of the model update. |
| Type: | salvus._core.types.int_ | None |
| Default value: | None |
| Description: | Maximum number of trial models to try at each iteration before returning. |
| Type: | bool |
| Default value: | True |
| Description: | Flag to fail if the maximum number of trial models is reached. If set to False, the iteration will complete without failing. The final model of this iteration will then simply correspond to the final model of the previous iteration. If this happens in the first iteration, the inversion will still fail, even if set to False. |
| Type: | dict | None |
| Default value: | None |
| Description: | Dictionary of covergence criteria. This can also be provided later on. |
| Type: | bool | typing.Literal['auto-detect'] |
| Default value: | 'auto-detect' |
| Description: | Flag to indicate whether the event-dependent gradients should be computed independently or whether it is sufficient to directly obtain the summed gradient accumulated from all events. Can be set to "auto-detect", which means that the InverseProblemConfiguration object will check if the forward simulation used event-dependent mesh masking and set the flag accordingly. Defaults to "auto-detect". |
| Type: | bool | None |
| Default value: | True |
| Description: | Flag to skip preconditioner. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.001 |
| Description: | Steering parameter for adjusting the trust region; see formulas above. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.5 |
| Description: | Steering parameter for adjusting the trust region; see formulas above. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.5 |
| Description: | Steering parameter for adjusting the trust region; see formulas above. |
| Type: | salvus._core.types.float_ |
| Default value: | 0.9 |
| Description: | Steering parameter for adjusting the trust region; see formulas above. |
| Type: | salvus._core.types.float_ |
| Default value: | 2.0 |
| Description: | Steering parameter for adjusting the trust region; see formulas above. |
def from_json(d: builtins.dict) -> Any: ...| Type: | builtins.dict |
| Description: | Dictionary containing its init parameters and a few other things. |
def iterate(
self,
it: Iteration[ModelType],
task_manager: dict[str, typing.Callable],
it_history: dict[int, Iteration[ModelType]] | None = None,
timer: Timer | None = None,
log_to_logger: bool = True,
) -> None: ...| Type: | Iteration[ModelType] |
| Description: | The current iteration. |
| Type: | dict[str, typing.Callable] |
| Description: | Dictionary of custom callback functions to process the tasks (e.g. for computing misfits) issued during the inversion. |
| Type: | dict[int, Iteration[ModelType]] | None |
| Default value: | None |
| Description: | Dictionary with the iteration history. |
| Type: | Timer | None |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | True |
| Description: | Whether to log messages to the logger. |
def resume(
self,
it: Iteration[ModelType],
it_history: dict[int, Iteration[ModelType]] | None = None,
timer: Timer | None = None,
log_to_logger: bool = True,
) -> None: ...| Type: | Iteration[ModelType] |
| Description: | Current iteration. |
| Type: | dict[int, Iteration[ModelType]] | None |
| Default value: | None |
| Description: | Dictionary with the iteration history. |
| Type: | Timer | None |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | True |
| Description: | Whether to log messages to the logger. |
def solve(
self,
current_iteration: Iteration[ModelType],
task_manager: dict[str, typing.Callable],
max_iterations: int,
it_history: dict[int, Iteration[ModelType]] | None = None,
convergence_criteria: dict | None = None,
) -> Iteration[ModelType]: ...| Type: | Iteration[ModelType] |
| Description: | The current iteration. |
| Type: | dict[str, typing.Callable] |
| Description: | Dictionary of custom callback functions to process the tasks (e.g. for computing misfits) issued during the inversion. |
| Type: | int |
| Description: | Maximum number of iterations to be computed. |
| Type: | dict[int, Iteration[ModelType]] | None |
| Default value: | None |
| Description: | Dictionary with the iteration history. |
| Type: | dict | None |
| Default value: | None |
| Description: | Dictionary of convergence criteria. This can also be provided later on. |
def to_json(
self,
external_file_hash: str | None = None,
timer: Timer | None = None,
log_to_logger: bool = False,
comm: int | None = None,
) -> dict: ...| Type: | str | None |
| Default value: | None |
| Description: | Hash of any external files associated with this object. Can be passed here in which case it will be stored in a centralized location in the JSON file. |
| Type: | Timer | None |
| Default value: | None |
| Description: | Execution timer. |
| Type: | bool |
| Default value: | False |
| Description: | Log timings to the logger. |
| Type: | int | None |
| Default value: | None |
| Description: | MPI communicator, if any. |