eb
compression_safeguards.safeguards.pointwise.qoi.eb
Pointwise quantity of interest (QoI) error bound safeguard.
Classes:
-
PointwiseQuantityOfInterestErrorBoundSafeguard–The
PointwiseQuantityOfInterestErrorBoundSafeguardguarantees that the
PointwiseQuantityOfInterestErrorBoundSafeguard
PointwiseQuantityOfInterestErrorBoundSafeguard(
qoi: PointwiseQuantityOfInterestExpression,
type: str | ErrorBound,
eb: int | float | str | Parameter,
qoi_dtype: str | ToFloatMode = lossless,
)
Bases: PointwiseSafeguard
The PointwiseQuantityOfInterestErrorBoundSafeguard guarantees that the
pointwise error type on a derived pointwise quantity of interest (QoI)
is less than or equal to the provided bound eb.
The quantity of interest is specified as a non-constant expression, in
string form, over the pointwise value x. For example, to bound the error
on the square of x, set qoi="square(x)" (or qoi="x**2").
If the derived quantity of interest for an element evaluates to an infinite value, this safeguard guarantees that the quantity of interest on the corrected value produces the exact same infinite value. For a NaN quantity of interest, this safeguard guarantees that the quantity of interest on the corrected value is also NaN, but does not guarantee that it has the same bit pattern.
The error bound can be verified by evaluating the QoI in the floating-point
data type selected by qoi_dtype parameter using the
evaluate_qoi method.
Please refer to the
PointwiseQuantityOfInterestExpression
for the EBNF grammar that specifies the language in which the quantities of
interest are written.
The implementation was originally inspired by:
Pu Jiao, Sheng Di, Hanqi Guo, Kai Zhao, Jiannan Tian, Dingwen Tao, Xin Liang, and Franck Cappello. (2022). Toward Quantity-of-Interest Preserving Lossy Compression for Scientific Data. Proceedings of the VLDB Endowment. 16, 4 (December 2022), 697-710. Available from: doi:10.14778/3574245.3574255.
| Parameters: |
|
|---|
| Raises: |
|
|---|
Methods:
-
evaluate_qoi–Evaluate the derived quantity of interest on the
datain the -
check_pointwise–Check which elements in the
approximationarray satisfy the error bound -
compute_safe_intervals–Compute the intervals in which the error bound is upheld with
-
compute_footprint–Compute the footprint of the
footarray, e.g. for expanding data -
compute_inverse_footprint–Compute the inverse footprint of the
footarray, e.g. for expanding -
get_config–Returns the configuration of the safeguard.
late_bound
property
The set of late-bound parameters that this safeguard has.
Late-bound parameters are only bound when checking and applying the safeguard, in contrast to the normal early-bound parameters that are configured during safeguard initialisation.
Late-bound parameters can be used for parameters that depend on the specific data that is to be safeguarded.
evaluate_qoi
Evaluate the derived quantity of interest on the data in the
floating-point data type selected by the qoi_dtype parameter.
| Parameters: |
|---|
| Returns: |
|---|
| Raises: |
|
|---|
check_pointwise
check_pointwise(
data: ndarray[S, dtype[T]],
approximation: ndarray[S, dtype[T]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Check which elements in the approximation array satisfy the error bound
for the quantity of interest on the data.
| Parameters: |
|
|---|
| Returns: |
|---|
| Raises: |
|
|---|
compute_safe_intervals
compute_safe_intervals(
data: ndarray[S, dtype[T]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> IntervalUnion[T, int, int]
Compute the intervals in which the error bound is upheld with
respect to the quantity of interest on the data.
| Parameters: |
|
|---|
| Returns: |
|
|---|
| Raises: |
|
|---|
compute_footprint
compute_footprint(
foot: ndarray[S, dtype[bool]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Compute the footprint of the foot array, e.g. for expanding data
points into the pointwise checks that they contribute to.
The footprint is equivalent to foot & where.
| Parameters: |
|
|---|
| Returns: |
|---|
compute_inverse_footprint
compute_inverse_footprint(
foot: ndarray[S, dtype[bool]],
*,
late_bound: Bindings,
where: Literal[True] | ndarray[S, dtype[bool]] = True,
) -> ndarray[S, dtype[bool]]
Compute the inverse footprint of the foot array, e.g. for expanding
pointwise check fails into the points that could have contributed to
the failures.
The inverse footprint is equivalent to foot & where.
| Parameters: |
|
|---|
| Returns: |
|---|