pymor.algorithms.hapod
¶
Module Contents¶
- pymor.algorithms.hapod.dist_hapod(num_slices, snapshots, eps, omega, arity=None, product=None, executor=None, eval_snapshots_in_executor=False)[source]¶
Distributed Hierarchical Approximate POD.
This computes the distributed HAPOD from [HLR18].
Parameters
- num_slices
The number of snapshot vector slices.
- snapshots
A mapping
snapshots(slice)
returning for each slice number the associated snapshot vectors.- eps
Desired l2-mean approximation error.
- omega
Tuning parameter (0 < omega < 1) to balance performance with approximation quality.
- arity
If not
None
, the arity of the HAPOD tree. Otherwise, a tree of depth 2 is used (one POD per slice and one additional POD of the resulting data).- product
Inner product
Operator
w.r.t. which to compute the POD.- executor
If not
None
, aconcurrent.futures.Executor
object to use for parallelization.- eval_snapshots_in_executor
If
True
also parallelize the evaluation of the snapshot map.
Returns
- modes
The computed POD modes.
- svals
The associated singular values.
- snap_count
The total number of input snapshot vectors.
- pymor.algorithms.hapod.dist_vectorarray_hapod(num_slices, U, eps, omega, arity=None, product=None, executor=None)[source]¶
Distributed Hierarchical Approximate POD.
This computes the distributed HAPOD from [HLR18] of a given
VectorArray
.Parameters
- num_slices
The number of snapshot vector slices.
- U
The
VectorArray
of which to compute the HAPOD.- eps
Desired l2-mean approximation error.
- omega
Tuning parameter (0 < omega < 1) to balance performance with approximation quality.
- arity
If not
None
, the arity of the HAPOD tree. Otherwise, a tree of depth 2 is used (one POD per slice and one additional POD of the resulting data).- product
Inner product
Operator
w.r.t. which to compute the POD.- executor
If not
None
, aconcurrent.futures.Executor
object to use for parallelization.
Returns
- modes
The computed POD modes.
- svals
The associated singular values.
- snap_count
The total number of input snapshot vectors.
- pymor.algorithms.hapod.hapod(tree, snapshots, local_eps, product=None, pod_method=default_pod_method, executor=None, eval_snapshots_in_executor=False)[source]¶
Compute the Hierarchical Approximate POD.
This is an implementation of the HAPOD algorithm from [HLR18].
Parameters
- tree
A
Tree
defining the worker topology.- snapshots
A mapping
snapshots(node)
returning for each leaf node the associated snapshot vectors.- local_eps
A mapping
local_eps(node, snap_count, num_vecs)
assigning to each tree nodenode
an l2 truncation error tolerance for the local pod based on the number of input vectorsnum_vecs
and the total number of snapshot vectors below the given nodesnap_count
.- product
Inner product
Operator
w.r.t. which to compute the POD.- pod_method
A function
pod_method(U, eps, root_node, product)
for computing the POD of theVectorArray
U
w.r.t. the given inner productproduct
and the l2 error toleranceeps
.root_node
is set toTrue
when the POD is computed at the root of the tree.- executor
If not
None
, aconcurrent.futures.Executor
object to use for parallelization.- eval_snapshots_in_executor
If
True
also parallelize the evaluation of the snapshot map.
Returns
- modes
The computed POD modes.
- svals
The associated singular values.
- snap_count
The total number of input snapshot vectors.
- pymor.algorithms.hapod.inc_hapod(steps, snapshots, eps, omega, product=None, executor=None)[source]¶
Incremental Hierarchical Approximate POD.
This computes the incremental HAPOD from [HLR18].
Parameters
- steps
The number of incremental POD updates. Has to agree with the length of
snapshots
.- snapshots
An iterable returning for each incremental POD step the associated snapshot vectors.
- eps
Desired l2-mean approximation error.
- omega
Tuning parameter (0 < omega < 1) to balance performance with approximation quality.
- product
Inner product
Operator
w.r.t. which to compute the POD.- executor
If not
None
, aconcurrent.futures.Executor
object to use to compute new snapshot vectors and POD updates in parallel.
Returns
- modes
The computed POD modes.
- svals
The associated singular values.
- snap_count
The total number of input snapshot vectors.
- pymor.algorithms.hapod.inc_vectorarray_hapod(steps, U, eps, omega, product=None)[source]¶
Incremental Hierarchical Approximate POD.
This computes the incremental HAPOD from [HLR18] for a given
VectorArray
.Parameters
- steps
The number of incremental POD updates.
- U
The
VectorArray
of which to compute the HAPOD.- eps
Desired l2-mean approximation error.
- omega
Tuning parameter (0 < omega < 1) to balance performance with approximation quality.
- product
Inner product
Operator
w.r.t. which to compute the POD.
Returns
- modes
The computed POD modes.
- svals
The associated singular values.
- snap_count
The total number of input snapshot vectors.