QoIEstimator¶
- class axtreme.qoi.qoi_estimator.QoIEstimator(*args, **kwargs)¶
Bases:
ProtocolA protocol for quantity of interest (QoI) estimators.
- __init__(*args, **kwargs)¶
Methods
__init__(*args, **kwargs)mean(x)Function that computes the mean of the QoI estimates (the output of the call() method).
var(x)Function that computes the variance of the QoI estimates (the output of the call() method).
- mean(x: Tensor) Tensor¶
Function that computes the mean of the QoI estimates (the output of the call() method).
For many applications this should just be using a default implementation that computes the mean. E.g using torch.mean(x).
However, in some special cases, it might be useful to provide a custom implementation to give a more accurate estimate. E.g. when UTSampler is used.
- Parameters:
x – A tensor of QoI estimates with shape (number_of_estimates,).
- Returns:
The mean of the QoI estimates. Should be a scalar.
- Return type:
torch.Tensor
- var(x: Tensor) Tensor¶
Function that computes the variance of the QoI estimates (the output of the call() method).
For many applications this should just be using a default implementation that computes the variance. E.g. using torch.var(x).
However, in some special cases, it might be useful to provide a custom implementation to give a more accurate estimate. E.g. when UTSampler is used.
- Parameters:
x – A tensor of QoI estimates with shape (number_of_estimates,).
- Returns:
The variance of the QoI estimates. Should be a scalar.
- Return type:
torch.Tensor