interface#
import tensorwaves.interface
Defines top-level interface of tensorwaves.
- class InputType#
The argument type of a
Function.__call__().alias of TypeVar(‘InputType’)
- class OutputType#
The return type of a
Function.__call__().alias of TypeVar(‘OutputType’)
- class Function[source]#
Bases:
ABC,Generic[InputType,OutputType]Generic representation of a mathematical function.
Representation of a mathematical function that computes
OutputTypevalues (co-domain) for a given set ofInputTypevalues (domain). Examples ofFunctionareParametrizedFunction,EstimatorandDataTransformer.- abstractmethod __call__(data: InputType) OutputType[source]#
Call self as a function.
- ParameterValue = complex | float#
Allowed types for parameter values.
- class ParametrizedFunction[source]#
Bases:
Function[InputType,OutputType]Interface of a callable function.
A
ParametrizedFunctionidentifies certain variables in a mathematical expression as parameters. Remaining variables are considered domain variables. Domain variables are the argument of the evaluation (see__call__()), while the parameters are controlled viaparameters(getter) andupdate_parameters()(setter). This mechanism is especially important for anEstimator.- abstractmethod __call__(data: InputType) OutputType[source]#
Call self as a function.
- class DataTransformer[source]#
Bases:
Function[dict[str,ndarray],dict[str,ndarray]]Transform one
DataSampleinto anotherDataSample.This changes the keys and values of the input
DataSampleto a specific outputDataSamplestructure.
- class Estimator[source]#
Bases:
Function[Mapping[str,complex|float],float]Estimator for discrepancy model and data.
See the
estimatormodule for different implementations of this interface.
- class FitResult(minimum_valid: bool, execution_time: float, function_calls: int, estimator_value: float, parameter_values: dict[str, TypeAliasForwardRef('tensorwaves.interface.ParameterValue')] = None, parameter_errors: dict[str, TypeAliasForwardRef('tensorwaves.interface.ParameterValue')] | None = None, iterations: int | None = None, specifics: Any | None = None)[source]#
Bases:
object- parameter_values: dict[str, ParameterValue][source]#
- specifics: Any | None[source]#
Any additional info provided by the specific optimizer.
An instance returned by one of the implemented optimizers under the
optimizermodule. Currently one of:This way, you can for instance get the
covariancematrix. See also Covariance matrix.
- class Optimizer[source]#
Bases:
ABCOptimize a fit model to a data set.
See the
optimizermodule for different implementations of this interface.
- class RealNumberGenerator[source]#
Bases:
ABCAbstract class for generating real numbers within a certain range.
Implementations can be found in the
tensorwaves.datamodule.
- class DataGenerator[source]#
Bases:
ABCAbstract class for generating a
DataSample.- abstractmethod generate(size: int, rng: RealNumberGenerator) DataSample[source]#
Generate a
DataSamplewithsizeevents.- Returns:
A
tupleof aDataSamplewith an array of weights.