pymor.algorithms.hapod

Module Contents

class pymor.algorithms.hapod.FakeExecutor[source]

Methods

submit

static submit(f, *args)[source]
Async:

class pymor.algorithms.hapod.LifoExecutor(executor, max_workers=None)[source]
done_callback(future, executor_future)[source]
async run_task()[source]
submit(f, *args)[source]
class pymor.algorithms.hapod.Node(tag=None, parent=None, after=None)[source]
add_child(tag=None, after=None, **kwargs)[source]
traverse(return_level=False)[source]
pymor.algorithms.hapod.default_pod_method(U, eps, is_root_node, product)[source]
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, a concurrent.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_hapod_tree(num_slices, arity=None)[source]
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, a concurrent.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 node node an l2 truncation error tolerance for the local pod based on the number of input vectors num_vecs and the total number of snapshot vectors below the given node snap_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 the VectorArray U w.r.t. the given inner product product and the l2 error tolerance eps. root_node is set to True when the POD is computed at the root of the tree.

executor

If not None, a concurrent.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, a concurrent.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_hapod_tree(steps)[source]
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.

pymor.algorithms.hapod.std_local_eps(tree, eps, omega, pod_on_leafs=True)[source]