Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F84797322
rational_interpolant_greedy_pivoted.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 24, 22:56
Size
22 KB
Mime Type
text/x-python
Expires
Thu, Sep 26, 22:56 (2 d)
Engine
blob
Format
Raw Data
Handle
21088318
Attached To
R6746 RationalROMPy
rational_interpolant_greedy_pivoted.py
View Options
# Copyright (C) 2018 by the RROMPy authors
#
# This file is part of RROMPy.
#
# RROMPy 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.
#
# RROMPy 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 Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with RROMPy. If not, see <http://www.gnu.org/licenses/>.
#
from
copy
import
deepcopy
as
copy
import
numpy
as
np
from
.generic_pivoted_approximant
import
GenericPivotedApproximant
,
PODGlobal
from
rrompy.reduction_methods.standard.greedy.rational_interpolant_greedy
\
import
RationalInterpolantGreedy
from
rrompy.reduction_methods.standard.greedy.generic_greedy_approximant
\
import
pruneSamples
from
rrompy.utilities.base.types
import
Np1D
from
rrompy.utilities.base
import
verbosityManager
as
vbMng
from
rrompy.utilities.numerical
import
dot
from
rrompy.utilities.numerical.degree
import
totalDegreeN
from
rrompy.utilities.poly_fitting.polynomial
import
polyvander
as
pv
from
rrompy.utilities.exception_manager
import
RROMPyAssert
from
rrompy.parameter
import
emptyParameterList
,
checkParameterList
__all__
=
[
'RationalInterpolantGreedyPivoted'
]
class
RationalInterpolantGreedyPivoted
(
GenericPivotedApproximant
,
RationalInterpolantGreedy
):
"""
ROM pivoted rational interpolant (with pole matching) computation for
parametric problems.
Args:
HFEngine: HF problem solver.
mu0(optional): Default parameter. Defaults to 0.
directionPivot(optional): Pivot components. Defaults to [0].
approxParameters(optional): Dictionary containing values for main
parameters of approximant. Recognized keys are:
- 'POD': whether to compute POD of snapshots; defaults to True;
- 'matchingWeight': weight for pole matching optimization; defaults
to 1;
- 'cutOffTolerance': tolerance for ignoring parasitic poles;
defaults to np.inf;
- 'cutOffKind': kind of cut off strategy; available values
include 'SOFT' and 'HARD'; defaults to 'HARD';
- 'S': total number of pivot samples current approximant relies
upon;
- 'samplerPivot': pivot sample point generator;
- 'SMarginal': total number of marginal samples current approximant
relies upon;
- 'samplerMarginal': marginal sample point generator;
- 'polybasis': type of polynomial basis for pivot
interpolation; defaults to 'MONOMIAL';
- 'polybasisMarginal': type of polynomial basis for marginal
interpolation; allowed values include 'MONOMIAL', 'CHEBYSHEV'
and 'LEGENDRE'; defaults to 'MONOMIAL';
- 'greedyTol': uniform error tolerance for greedy algorithm;
defaults to 1e-2;
- 'collinearityTol': collinearity tolerance for greedy algorithm;
defaults to 0.;
- 'maxIter': maximum number of greedy steps; defaults to 1e2;
- 'nTestPoints': number of test points; defaults to 5e2;
- 'trainSetGenerator': training sample points generator; defaults
to sampler;
- 'errorEstimatorKind': kind of error estimator; available values
include 'AFFINE', 'DISCREPANCY', 'INTERPOLATORY',
'LOOK_AHEAD', and 'NONE'; defaults to 'NONE';
- 'MMarginal': degree of marginal interpolant; defaults to 'AUTO',
i.e. maximum allowed;
- 'polydegreetypeMarginal': type of polynomial degree for marginal;
defaults to 'TOTAL';
- 'radialDirectionalWeightsMarginal': radial basis weights for
marginal interpolant; defaults to 1;
- 'nNearestNeighborMarginal': number of marginal nearest neighbors
considered if polybasisMarginal allows; defaults to -1;
- 'interpRcond': tolerance for pivot interpolation; defaults to
None;
- 'interpRcondMarginal': tolerance for marginal interpolation;
defaults to None;
- 'robustTol': tolerance for robust rational denominator
management; defaults to 0.
Defaults to empty dict.
approx_state(optional): Whether to approximate state. Defaults to
False.
verbosity(optional): Verbosity level. Defaults to 10.
Attributes:
HFEngine: HF problem solver.
mu0: Default parameter.
directionPivot: Pivot components.
mus: Array of snapshot parameters.
musMarginal: Array of marginal snapshot parameters.
approxParameters: Dictionary containing values for main parameters of
approximant. Recognized keys are in parameterList.
parameterListSoft: Recognized keys of soft approximant parameters:
- 'POD': whether to compute POD of snapshots;
- 'matchingWeight': weight for pole matching optimization;
- 'cutOffTolerance': tolerance for ignoring parasitic poles;
- 'cutOffKind': kind of cut off strategy;
- 'polybasis': type of polynomial basis for pivot
interpolation;
- 'polybasisMarginal': type of polynomial basis for marginal
interpolation;
- 'greedyTol': uniform error tolerance for greedy algorithm;
- 'collinearityTol': collinearity tolerance for greedy algorithm;
- 'maxIter': maximum number of greedy steps;
- 'nTestPoints': number of test points;
- 'trainSetGenerator': training sample points generator;
- 'errorEstimatorKind': kind of error estimator;
- 'MMarginal': degree of marginal interpolant;
- 'polydegreetypeMarginal': type of polynomial degree for marginal;
- 'radialDirectionalWeightsMarginal': radial basis weights for
marginal interpolant;
- 'nNearestNeighbor': number of pivot nearest neighbors considered
if polybasis allows;
- 'nNearestNeighborMarginal': number of marginal nearest neighbors
considered if polybasisMarginal allows;
- 'interpRcond': tolerance for pivot interpolation;
- 'interpRcondMarginal': tolerance for marginal interpolation;
- 'robustTol': tolerance for robust rational denominator
management;
- 'correctorForce': whether corrector should forcefully delete bad
poles;
- 'correctorTol': tolerance for corrector step;
- 'correctorMaxIter': maximum number of corrector iterations.
parameterListCritical: Recognized keys of critical approximant
parameters:
- 'S': total number of pivot samples current approximant relies
upon;
- 'samplerPivot': pivot sample point generator;
- 'SMarginal': total number of marginal samples current approximant
relies upon;
- 'samplerMarginal': marginal sample point generator.
approx_state: Whether to approximate state.
verbosity: Verbosity level.
POD: Whether to compute POD of snapshots.
matchingWeight: Weight for pole matching optimization.
cutOffTolerance: Tolerance for ignoring parasitic poles.
cutOffKind: Kind of cut off strategy.
S: Total number of pivot samples current approximant relies upon.
samplerPivot: Pivot sample point generator.
SMarginal: Total number of marginal samples current approximant relies
upon.
samplerMarginal: Marginal sample point generator.
polybasis: Type of polynomial basis for pivot interpolation.
polybasisMarginal: Type of polynomial basis for marginal interpolation.
greedyTol: uniform error tolerance for greedy algorithm.
collinearityTol: Collinearity tolerance for greedy algorithm.
maxIter: maximum number of greedy steps.
nTestPoints: number of starting training points.
trainSetGenerator: training sample points generator.
errorEstimatorKind: kind of error estimator.
MMarginal: Degree of marginal interpolant.
polydegreetypeMarginal: Type of polynomial degree for marginal.
radialDirectionalWeightsMarginal: Radial basis weights for marginal
interpolant.
nNearestNeighborMarginal: Number of marginal nearest neighbors
considered if polybasisMarginal allows.
interpRcond: Tolerance for pivot interpolation.
interpRcondMarginal: Tolerance for marginal interpolation.
robustTol: Tolerance for robust rational denominator management.
muBounds: list of bounds for pivot parameter values.
muBoundsMarginal: list of bounds for marginal parameter values.
samplingEngine: Sampling engine.
uHF: High fidelity solution(s) with parameter(s) lastSolvedHF as
sampleList.
lastSolvedHF: Parameter(s) corresponding to last computed high fidelity
solution(s) as parameterList.
uApproxReduced: Reduced approximate solution(s) with parameter(s)
lastSolvedApprox as sampleList.
lastSolvedApproxReduced: Parameter(s) corresponding to last computed
reduced approximate solution(s) as parameterList.
uApprox: Approximate solution(s) with parameter(s) lastSolvedApprox as
sampleList.
lastSolvedApprox: Parameter(s) corresponding to last computed
approximate solution(s) as parameterList.
Q: Numpy 1D vector containing complex coefficients of approximant
denominator.
P: Numpy 2D vector whose columns are FE dofs of coefficients of
approximant numerator.
"""
def
__init__
(
self
,
*
args
,
**
kwargs
):
self
.
_preInit
()
self
.
_addParametersToList
(
toBeExcluded
=
[
"sampler"
])
super
()
.
__init__
(
*
args
,
**
kwargs
)
self
.
_postInit
()
@property
def
tModelType
(
self
):
if
hasattr
(
self
,
"_temporaryPivot"
):
return
RationalInterpolantGreedy
.
tModelType
.
fget
(
self
)
return
super
()
.
tModelType
@property
def
polybasis0
(
self
):
if
"_"
in
self
.
polybasis
:
return
self
.
polybasis
.
split
(
"_"
)[
0
]
return
self
.
polybasis
def
_polyvanderAuxiliary
(
self
,
mus
,
deg
,
*
args
):
degEff
=
[
0
]
*
self
.
npar
degEff
[
self
.
directionPivot
[
0
]]
=
deg
return
pv
(
mus
,
degEff
,
*
args
)
def
_marginalizeMiscellanea
(
self
,
forward
:
bool
):
if
forward
:
self
.
_m_mu0
=
copy
(
self
.
mu0
)
self
.
_m_selfmus
=
copy
(
self
.
mus
)
self
.
_m_HFErescalingExp
=
copy
(
self
.
HFEngine
.
rescalingExp
)
self
.
_mu0
=
checkParameterList
(
self
.
mu0
(
self
.
directionPivot
),
1
)[
0
]
self
.
_mus
=
checkParameterList
(
self
.
mus
(
self
.
directionPivot
),
1
)[
0
]
self
.
HFEngine
.
rescalingExp
=
[
self
.
HFEngine
.
rescalingExp
[
self
.
directionPivot
[
0
]]]
else
:
self
.
_mu0
=
self
.
_m_mu0
self
.
_mus
=
self
.
_m_selfmus
self
.
HFEngine
.
rescalingExp
=
self
.
_m_HFErescalingExp
del
self
.
_m_mu0
,
self
.
_m_selfmus
,
self
.
_m_HFErescalingExp
def
_marginalizeTrainedModel
(
self
,
forward
:
bool
):
if
forward
:
del
self
.
_temporaryPivot
self
.
trainedModel
.
data
.
mu0
=
self
.
mu0
self
.
trainedModel
.
data
.
scaleFactor
=
[
1.
]
*
self
.
npar
self
.
trainedModel
.
data
.
scaleFactor
[
self
.
directionPivot
[
0
]]
=
(
self
.
scaleFactor
[
0
])
self
.
trainedModel
.
data
.
rescalingExp
=
self
.
HFEngine
.
rescalingExp
Qc
=
np
.
zeros
((
len
(
self
.
trainedModel
.
data
.
Q
.
coeffs
),)
*
self
.
npar
,
dtype
=
self
.
trainedModel
.
data
.
Q
.
coeffs
.
dtype
)
Pc
=
np
.
zeros
((
len
(
self
.
trainedModel
.
data
.
P
.
coeffs
),)
*
self
.
npar
+
(
self
.
trainedModel
.
data
.
P
.
coeffs
.
shape
[
1
],),
dtype
=
self
.
trainedModel
.
data
.
P
.
coeffs
.
dtype
)
for
j
in
range
(
len
(
self
.
trainedModel
.
data
.
Q
.
coeffs
)):
Qc
[(
0
,)
*
self
.
directionPivot
[
0
]
+
(
j
,)
+
(
0
,)
*
(
self
.
npar
-
self
.
directionPivot
[
0
]
-
1
)]
=
(
self
.
trainedModel
.
data
.
Q
.
coeffs
[
j
])
for
j
in
range
(
len
(
self
.
trainedModel
.
data
.
P
.
coeffs
)):
for
k
in
range
(
self
.
trainedModel
.
data
.
P
.
coeffs
.
shape
[
1
]):
Pc
[(
0
,)
*
self
.
directionPivot
[
0
]
+
(
j
,)
+
(
0
,)
*
(
self
.
npar
-
self
.
directionPivot
[
0
]
-
1
)
+
(
k
,)]
=
self
.
trainedModel
.
data
.
P
.
coeffs
[
j
,
k
]
self
.
trainedModel
.
data
.
Q
.
coeffs
=
Qc
self
.
trainedModel
.
data
.
P
.
coeffs
=
Pc
self
.
_m_musUniqueCN
=
copy
(
self
.
_musUniqueCN
)
musUniqueCNAux
=
np
.
zeros
((
self
.
S
,
self
.
npar
),
dtype
=
self
.
_musUniqueCN
.
dtype
)
musUniqueCNAux
[:,
self
.
directionPivot
[
0
]]
=
self
.
_musUniqueCN
(
0
)
self
.
_musUniqueCN
=
checkParameterList
(
musUniqueCNAux
,
self
.
npar
)[
0
]
self
.
_m_derIdxs
=
copy
(
self
.
_derIdxs
)
for
j
in
range
(
len
(
self
.
_derIdxs
)):
for
l
in
range
(
len
(
self
.
_derIdxs
[
j
])):
derjl
=
self
.
_derIdxs
[
j
][
l
][
0
]
self
.
_derIdxs
[
j
][
l
]
=
[
0
]
*
self
.
npar
self
.
_derIdxs
[
j
][
l
][
self
.
directionPivot
[
0
]]
=
derjl
else
:
self
.
_temporaryPivot
=
1
self
.
trainedModel
.
data
.
mu0
=
checkParameterList
(
self
.
mu0
(
self
.
directionPivot
),
1
)[
0
]
self
.
trainedModel
.
data
.
scaleFactor
=
self
.
scaleFactor
self
.
trainedModel
.
data
.
rescalingExp
=
self
.
HFEngine
.
rescalingExp
[
self
.
directionPivot
[
0
]]
self
.
trainedModel
.
data
.
Q
.
coeffs
=
self
.
trainedModel
.
data
.
Q
.
coeffs
[
(
0
,)
*
self
.
directionPivot
[
0
]
+
(
slice
(
None
),)
+
(
0
,)
*
(
self
.
HFEngine
.
npar
-
1
-
self
.
directionPivot
[
0
])]
self
.
trainedModel
.
data
.
P
.
coeffs
=
self
.
trainedModel
.
data
.
P
.
coeffs
[
(
0
,)
*
self
.
directionPivot
[
0
]
+
(
slice
(
None
),)
+
(
0
,)
*
(
self
.
HFEngine
.
npar
-
1
-
self
.
directionPivot
[
0
])]
self
.
_musUniqueCN
=
copy
(
self
.
_m_musUniqueCN
)
self
.
_derIdxs
=
copy
(
self
.
_m_derIdxs
)
del
self
.
_m_musUniqueCN
,
self
.
_m_derIdxs
self
.
trainedModel
.
data
.
npar
=
self
.
npar
self
.
trainedModel
.
data
.
Q
.
npar
=
self
.
npar
self
.
trainedModel
.
data
.
P
.
npar
=
self
.
npar
def
errorEstimator
(
self
,
mus
:
Np1D
,
return_max
:
bool
=
False
)
->
Np1D
:
"""Standard residual-based error estimator."""
self
.
_marginalizeMiscellanea
(
True
)
setupOK
=
self
.
setupApproxLocal
()
self
.
_marginalizeMiscellanea
(
False
)
if
setupOK
>
0
:
err
=
np
.
empty
(
len
(
mus
))
err
[:]
=
np
.
nan
if
not
return_max
:
return
err
return
err
,
-
setupOK
,
np
.
nan
self
.
_marginalizeTrainedModel
(
True
)
errRes
=
super
()
.
errorEstimator
(
mus
,
return_max
)
self
.
_marginalizeTrainedModel
(
False
)
return
errRes
def
_preliminaryTraining
(
self
):
"""Initialize starting snapshots of solution map."""
RROMPyAssert
(
self
.
_mode
,
message
=
"Cannot start greedy algorithm."
)
S
=
self
.
S
self
.
sampleBatchIdx
,
self
.
sampleBatchSize
,
self
.
_S
=
-
1
,
0
,
0
nextBatchSize
=
1
while
self
.
_S
+
nextBatchSize
<=
S
:
self
.
sampleBatchIdx
+=
1
self
.
sampleBatchSize
=
nextBatchSize
self
.
_S
+=
self
.
sampleBatchSize
nextBatchSize
=
totalDegreeN
(
self
.
npar
-
1
,
self
.
sampleBatchIdx
+
1
)
self
.
resetSamples
()
musPivot
=
self
.
trainSetGenerator
.
generatePoints
(
self
.
S
)
while
len
(
musPivot
)
>
self
.
S
:
musPivot
.
pop
()
muTestPivot
=
self
.
samplerPivot
.
generatePoints
(
self
.
nTestPoints
,
False
)
idxPop
=
pruneSamples
(
muTestPivot
**
self
.
HFEngine
.
rescalingExp
[
self
.
directionPivot
[
0
]],
musPivot
**
self
.
HFEngine
.
rescalingExp
[
self
.
directionPivot
[
0
]],
1e-10
*
self
.
scaleFactor
[
0
])
self
.
mus
=
emptyParameterList
()
self
.
mus
.
reset
((
self
.
S
,
self
.
npar
+
len
(
self
.
musMargLoc
)))
muTestBase
=
emptyParameterList
()
muTestBase
.
reset
((
len
(
muTestPivot
),
self
.
npar
+
len
(
self
.
musMargLoc
)))
for
k
in
range
(
self
.
S
):
self
.
mus
.
data
[
k
,
self
.
directionPivot
]
=
musPivot
[
k
]
.
data
self
.
mus
.
data
[
k
,
self
.
directionMarginal
]
=
self
.
musMargLoc
.
data
for
k
in
range
(
len
(
muTestPivot
)):
muTestBase
.
data
[
k
,
self
.
directionPivot
]
=
muTestPivot
[
k
]
.
data
muTestBase
.
data
[
k
,
self
.
directionMarginal
]
=
self
.
musMargLoc
.
data
muTestBase
.
pop
(
idxPop
)
muLast
=
copy
(
self
.
mus
[
-
1
])
self
.
mus
.
pop
()
if
len
(
self
.
mus
)
>
0
:
vbMng
(
self
,
"MAIN"
,
(
"Adding first {} sample point{} at {} to training "
"set."
)
.
format
(
self
.
S
-
1
,
""
+
"s"
*
(
self
.
S
>
2
),
self
.
mus
),
2
)
self
.
samplingEngine
.
iterSample
(
self
.
mus
)
self
.
_S
=
len
(
self
.
mus
)
self
.
_approxParameters
[
"S"
]
=
self
.
S
self
.
muTest
=
emptyParameterList
()
self
.
muTest
.
reset
((
len
(
muTestBase
)
+
1
,
self
.
mus
.
shape
[
1
]))
self
.
muTest
.
data
[:
-
1
]
=
muTestBase
.
data
self
.
muTest
.
data
[
-
1
]
=
muLast
.
data
def
_finalizeSnapshots
(
self
):
self
.
setupSampling
()
self
.
samplingEngine
.
resetHistory
(
len
(
self
.
musMarginal
))
for
j
in
range
(
len
(
self
.
musMarginal
)):
self
.
samplingEngine
.
setsample
(
self
.
samplingEngs
[
j
]
.
samples
,
j
,
False
)
self
.
samplingEngine
.
mus
[
j
]
=
copy
(
self
.
samplingEngs
[
j
]
.
mus
)
self
.
samplingEngine
.
musMarginal
[
j
]
=
copy
(
self
.
musMarginal
[
j
])
self
.
samplingEngine
.
nsamples
[
j
]
=
self
.
samplingEngs
[
j
]
.
nsamples
if
self
.
POD
:
self
.
samplingEngine
.
RPOD
[
j
]
=
self
.
samplingEngs
[
j
]
.
RPOD
self
.
samplingEngine
.
samples_full
[
j
]
.
data
=
(
self
.
samplingEngs
[
j
]
.
samples_full
.
data
)
if
self
.
POD
==
PODGlobal
:
self
.
samplingEngine
.
coalesceSamples
(
self
.
interpRcondMarginal
)
else
:
self
.
samplingEngine
.
coalesceSamples
()
def
setupApprox
(
self
,
*
args
,
**
kwargs
)
->
int
:
"""Compute rational interpolant."""
if
self
.
checkComputedApprox
():
return
-
1
RROMPyAssert
(
self
.
_mode
,
message
=
"Cannot setup approximant."
)
vbMng
(
self
,
"INIT"
,
"Setting up {}."
.
format
(
self
.
name
()),
5
)
self
.
musMarginal
=
self
.
samplerMarginal
.
generatePoints
(
self
.
SMarginal
)
while
len
(
self
.
musMarginal
)
>
self
.
SMarginal
:
self
.
musMarginal
.
pop
()
S0
=
copy
(
self
.
S
)
Qs
,
Ps
=
[
None
]
*
len
(
self
.
musMarginal
),
[
None
]
*
len
(
self
.
musMarginal
)
self
.
samplingEngs
=
[
None
]
*
len
(
self
.
musMarginal
)
self
.
computeScaleFactor
()
self
.
_scaleFactorOldPivot
=
copy
(
self
.
scaleFactor
)
self
.
scaleFactor
=
self
.
scaleFactorPivot
self
.
_temporaryPivot
=
1
for
j
in
range
(
len
(
self
.
musMarginal
)):
self
.
_S
=
S0
self
.
musMargLoc
=
self
.
musMarginal
[
j
]
RationalInterpolantGreedy
.
setupSampling
(
self
)
self
.
trainedModel
=
None
self
.
verbosity
-=
5
self
.
samplingEngine
.
verbosity
-=
5
super
()
.
setupApprox
(
*
args
,
**
kwargs
)
self
.
verbosity
+=
5
self
.
samplingEngine
.
verbosity
+=
5
self
.
samplingEngs
[
j
]
=
copy
(
self
.
samplingEngine
)
Qs
[
j
]
=
copy
(
self
.
trainedModel
.
data
.
Q
)
Ps
[
j
]
=
copy
(
self
.
trainedModel
.
data
.
P
)
self
.
scaleFactor
=
self
.
_scaleFactorOldPivot
del
self
.
_scaleFactorOldPivot
,
self
.
_temporaryPivot
self
.
_finalizeSnapshots
()
del
self
.
musMargLoc
,
self
.
samplingEngs
self
.
_mus
=
self
.
samplingEngine
.
musCoalesced
padLeft
=
0
if
self
.
POD
!=
PODGlobal
:
padRight
=
self
.
samplingEngine
.
nsamplesTot
for
j
in
range
(
len
(
self
.
musMarginal
)):
nsj
=
self
.
samplingEngine
.
nsamples
[
j
]
if
self
.
POD
==
PODGlobal
:
rRightj
=
self
.
samplingEngine
.
RPODCPart
[:,
padLeft
:
padLeft
+
nsj
]
Ps
[
j
]
.
postmultiplyTensorize
(
rRightj
.
T
)
else
:
padRight
-=
nsj
Ps
[
j
]
.
pad
(
padLeft
,
padRight
)
padLeft
+=
nsj
pMat
=
self
.
samplingEngine
.
samplesCoalesced
.
data
pMatEff
=
dot
(
self
.
HFEngine
.
C
,
pMat
)
if
self
.
approx_state
else
pMat
self
.
trainedModel
=
self
.
tModelType
()
self
.
trainedModel
.
verbosity
=
self
.
verbosity
self
.
trainedModel
.
timestamp
=
self
.
timestamp
datadict
=
{
"mu0"
:
self
.
mu0
,
"projMat"
:
pMatEff
,
"scaleFactor"
:
self
.
scaleFactor
,
"rescalingExp"
:
self
.
HFEngine
.
rescalingExp
,
"directionPivot"
:
self
.
directionPivot
}
self
.
trainedModel
.
data
=
self
.
initializeModelData
(
datadict
)[
0
]
self
.
trainedModel
.
data
.
mus
=
copy
(
self
.
mus
)
self
.
trainedModel
.
data
.
musMarginal
=
copy
(
self
.
musMarginal
)
self
.
trainedModel
.
data
.
Qs
,
self
.
trainedModel
.
data
.
Ps
=
Qs
,
Ps
vbMng
(
self
,
"INIT"
,
"Matching poles."
,
10
)
self
.
trainedModel
.
initializeFromRational
(
self
.
HFEngine
,
self
.
matchingWeight
,
self
.
POD
==
PODGlobal
,
self
.
approx_state
)
vbMng
(
self
,
"DEL"
,
"Done matching poles."
,
10
)
self
.
_finalizeMarginalization
()
vbMng
(
self
,
"DEL"
,
"Done setting up approximant."
,
5
)
return
0
Event Timeline
Log In to Comment