_InterpolatedOperator#
- class _InterpolatedOperator(training_parameters=None, entries=None, InterpolatorClass: type = None, fromblock=False)[source]#
Base class for parametric operators where the parameter dependence is handled with element-wise interpolation.
For a set of training parameter values \(\{\bfmu_i\}_{i=1}^{s}\), this type of operator is given by \(\Ophat_\ell(\qhat, \u, \bfmu) = \Ohat_\ell(\bfmu)\d(\qhat, \u)\) where \(\Ohat_{\ell}(\bfmu)\) is calculated by interpolating operator entries that correspond to each parameter value:
\[\Ohat_{\ell}(\bfmu) = \textrm{interpolate}( (\bfmu_1,\Ohat_{\ell}^{(1)}),\ldots,(\Ohat_{\ell}^{(s)}\bfmu_s);\bfmu),\]where \(\Ohat_\ell^{(i)} = \Ohat_\ell(\bfmu_i)\) for each \(i=1,\ldots,s\).
Parent class:
opinf.operators._base._ParametricOperator
Child classes:
- Parameters
- training_parameterslist of s scalars or (p,) 1D ndarrays
Parameter values for which the operator entries are known or will be inferred from data. If not provided in the constructor, use
set_training_parameters()
later.- entrieslist of s ndarrays, or None
Operator entries corresponding to the
training_parameters
. If not provided in the constructor, useset_entries()
later.- InterpolatorClasstype or None
Class for the elementwise interpolation. Must obey the syntax
>>> interpolator = InterpolatorClass(data_points, data_values) >>> interpolator_evaluation = interpolator(new_data_point)
This can be, e.g., a class from
scipy.interpolate
. IfNone
(default), usescipy.interpolate.CubicSpline
for one-dimensional parameters andscipy.interpolate.LinearNDInterpolator
otherwise. If not provided in the constructor, useset_interpolator()
later.- fromblockbool
If
True
, interpretentries
as a horizontal concatenation of arrays; ifFalse
(default), interpretentries
as a list of arrays.
Properties
OperatorClass
Nonparametric
opinf.operators
class that represents this parametric operator evaluated at a particular parameter value.entries
Operator entries corresponding to the training parameters values, i.e.,
entries[i]
are the operator entries corresponding to the parameter valuetraining_parameters[i]
.interpolator
Interpolator object for evaluating the operator at specified parameter values.
parameter_dimension
Dimension of the parameters \(\bfmu\) that the operator acts on.
shape
Shape of the operator entries matrix when evaluated at a parameter value.
state_dimension
Dimension of the state \(\qhat\) that the operator acts on.
training_parameters
Parameter values for which the operator entries are known.
Methods
Apply the operator to the given state and input at the specified parameter value, \(\Ophat_\ell(\qhat,\u;\bfmu)\).
Return a copy of the operator.
Return the data matrix block corresponding to the operator.
Evaluate the operator at the given parameter value, \(\Ophat_{\ell}(\cdot,\cdot;\bfmu)\).
Project this operator to a low-dimensional linear space.
Construct the state Jacobian of the operator, \(\ddqhat\Ophat_\ell(\qhat,\u;\bfmu)\).
Load a parametric operator from an HDF5 file.
Number of columns sd in the concatenated operator matrix \([~\Ohat_{\ell}^{(1)}~~\cdots~~\Ohat_{\ell}^{(s)}~]\).
Save the operator to an HDF5 file.
Set the operator entries, the matrices \(\Ohat_{\ell}^{(1)},\ldots,\Ohat_{\ell}^{(s)}\).
Construct the interpolator for the operator entries.
Set the training parameter values.