pybop.costs.feature_distances#
Classes#
Exponential fit cost function. |
|
Base for defining cost functions based on comparing fit functions. |
|
Square-root fit cost function. |
Functions#
|
Module Contents#
- class pybop.costs.feature_distances.ExponentialFeatureDistance(domain_data: numpy.ndarray, target_data: numpy.ndarray, feature: str = 'inverse_timescale', time_start: float = None, time_end: float = None)[source]#
Bases:
FeatureDistanceExponential fit cost function.
Fits an exponential and compares either its asymptote, its magnitude, or its timescale between model predictions and target data.
- _supported_features = ['asymptote', 'magnitude', 'timescale', 'inverse_timescale']#
- class pybop.costs.feature_distances.FeatureDistance(domain_data: numpy.ndarray, target_data: numpy.ndarray, feature: str, time_start: float = None, time_end: float = None)[source]#
Bases:
pybop.costs.base_cost.BaseCostBase for defining cost functions based on comparing fit functions.
- __call__(y: numpy.ndarray, dy: numpy.ndarray | None = None) float | tuple[float, numpy.ndarray][source]#
- _fit(t, y)[source]#
Uses SciPy to fit data. For numerical reasons, the fitting involves applying the fit function to data and comparing to identity.
- _domain_data#
- _supported_features = []#
- _target_data#
- end_index#
- feature#
- start_index#
- time_end = None#
- time_start = None#
- class pybop.costs.feature_distances.SquareRootFeatureDistance(domain_data: numpy.ndarray, target_data: numpy.ndarray, feature: str = 'inverse_slope', time_start: float = None, time_end: float = None)[source]#
Bases:
FeatureDistanceSquare-root fit cost function.
Fits a square-root fit function and compares either its offset or its slope between model predictions and target data.
- _supported_features = ['offset', 'slope', 'inverse_slope']#