Package pod
source code
Framework for performing a Proper Orthogonal Decomposition (POD).
Useful references:
-
http://en.wikipedia.org/wiki/Homogeneous_coordinates
-
http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
Usage example:
>>> import pod
>>> refs = [ [-4.0, -1.0],
>>> [-2.0, -1.0],
>>> [3.0, 4.0] ]
>>> target = [-2.0, 1.5]
>>> decomposition = pod.decompose(target, refs, epsilon=1E-6, max_iter=90)
>>> print decomposition.get_decomposition()
[-1.9999991745134178, 1.4999993808850638]
>>> print decomposition.get_reference_weights()
[0.96153806466991254, 0.0, 0.61538436138874408]
The example above shows the reconstruction of the target using 3
reference signals, from which only reference 1 and reference 3 are useful
(reference 2 is assigned a weight of 0).
Author:
Christophe Alexandre <ch.alexandre at bluewin dot ch>
License:
Copyright(C) 2010 Christophe Alexandre
This program is free software: you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this program. If not, see
<http://www.gnu.org/licenses/lgpl.txt>.
- pod.linalg: Basic linear algebra components and functions.
- pod.util: Operations on matrices and various tools.
- pod.vecspace: Toolbox for handling projections onto linear varieties.
|
|
|
IterativeDecomposition
|
decompose(source,
references,
epsilon=1e-010,
max_iter=20,
max_factors=None,
max_weight=None,
distance=<function func at 0x00CCFC70>)
Decomposing the source using the proposed reference points. |
source code
|
|
Distance function used for ordering the projections.
A weight of 0.0 defines the distance to the projected point, while a
weight of 1.0 defines the distance relative to the point generating the
line.
At each iteration step the current point is projected onto the closest
of all lines.
- Parameters:
generator_weight (float usually in range [0.0, 1.0]) - how much weight is assigned to the generator point
|
decompose(source,
references,
epsilon=1e-010,
max_iter=20,
max_factors=None,
max_weight=None,
distance=<function func at 0x00CCFC70>)
| source code
|
Decomposing the source using the proposed reference points.
- Parameters:
source (list) - input point
references (list) - list of reference points
epsilon (float) - limit of the error sequence for stopping iteration
max_iter (int) - safeguard for stopping iteration
max_factors (int) - limit for the number of reference points, None allowing to use
all of them
distance (a function of start point, projected point, generator point) - function used for finding the closest line to project on
- Returns: IterativeDecomposition
- decomposition details
|