Skip to content

Implement EstimatorSum #560

Description

@redeboer

https://github.com/ComPWA/K-matrix-research/issues/65 seems to work quite well and can be implemented in TensorWaves. This requires writing some simple test with two UnbinnedNLL estimators.

For instance:

from collections.abc import Iterable, Mapping
from tensorwaves.interface import Estimator, ParameterValue


class EstimatorSum(Estimator):
    def __init__(self, estimators: Iterable[Estimator]) -> None:
        self.__estimators = tuple(estimators)

    def __call__(self, parameters: Mapping[str, ParameterValue]) -> float:
        return sum(estimator(parameters) for estimator in self.__estimators)

    def gradient(
        self, parameters: Mapping[str, ParameterValue]
    ) -> dict[str, ParameterValue]:
        raise NotImplementedError

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

✨ FeatureNew feature added to the package

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions