salvus.project.configuration.misfit_configuration
Classes
MisfitConfiguration
MisfitConfigurationclass MisfitConfiguration(
salvus.flow.utils.serialization_helpers.SerializationMixin
):
def __init__(
self,
name: str,
observed_data: Optional[str],
misfit_function: Union[str, Dict[str, Union[str, int]], Callable],
extra_kwargs_misfit_function: Optional[Dict] = None,
receiver_field: str,
data_selection_configuration: Optional[str] = None,
max_samples_for_misfit_computation: Optional[
int, numpy.int32, numpy.int64
] = None,
normalization: Optional[str] = None,
) -> None:
...Misfit configuration object.
Parameters
namestr — The name of the misfit configuration. Must be unique per project.observed_dataOptional[str] — The observed data name. Can beNoneif the misfit function does not requireobserved_data.misfit_functionUnion[str, Dict[str, Union[str, int]], Callable] — The misfit function or name of the function. Can be one of three things: 1. The of one of Salvus’ built-in misfit functions. In that case the latest available version will be chosen. 2. A dictionary of the form{"misfit_name": "L2", "version": 1}to directly select a specific version of a built-in misfit function. 3. A custom function that computes misfits and adjoint sources.extra_kwargs_misfit_functionOptional[Dict] — Any potentially extra misfit arguments.receiver_fieldstr — The receiver field to use.data_selection_configurationOptional[str] — Optional data selection configuration to be applied to all data sets during the misfit and adjoint source calculation.max_samples_for_misfit_computationOptional[int, numpy.int32, numpy.int64] — If given, and if the number of samples in the data for the misfit and adjoint source computation is larger than the given number, synthetic and observed data will be downsampled to the chosen number of samples and the adjoint source will later be upsampled again. Very useful for some expensive to compute misfits with strongly oversampled signals. The adjoint source will be correctly scaled at the end. This does result in the adjoint source no longer being the exact discrete derivative of the misfit but in most cases this should not be a problem.normalizationOptional[str] — If given, normalize the observed and synthetic traces prior to misfit and adjoint source computations. This will be accounted for during the computation of the derivatives to ensure consistency. Useful for some problems but it does make them a bit more non-linear. Available choices: *"l2_energy_per_measurement": Normalize each trace by the L2-norm of the weighted trace.
Methods
from_json()
from_json()def from_json(d: Dict) -> MisfitConfiguration:
...Construct object from a JSON-serializable dictionary.
Parameters
dDict — JSON dictionary of the inverse problem.
Returns MisfitConfiguration
to_json()
to_json()def to_json(self) -> Dict:
...Convert object to a JSON-serializable dictionary.
Returns Dict