Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F81389328
trained_model_pivoted_data.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
Thu, Sep 5, 17:59
Size
2 KB
Mime Type
text/x-python
Expires
Sat, Sep 7, 17:59 (2 d)
Engine
blob
Format
Raw Data
Handle
20556827
Attached To
R6746 RationalROMPy
trained_model_pivoted_data.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
rrompy.reduction_methods.base.trained_model
import
TrainedModelData
from
rrompy.utilities.base.types
import
Np2D
,
List
,
ListAny
,
paramVal
from
rrompy.parameter
import
checkParameterList
__all__
=
[
'TrainedModelPivotedData'
]
class
TrainedModelPivotedData
(
TrainedModelData
):
"""ROM approximant evaluation data (must be pickle-able)."""
def
__init__
(
self
,
mu0
:
paramVal
,
projMat
:
Np2D
,
scaleFactor
:
ListAny
=
[
1.
],
rescalingExp
:
List
[
float
]
=
[
1.
],
directionPivot
:
ListAny
=
[
0
]):
super
()
.
__init__
(
mu0
,
projMat
,
scaleFactor
,
rescalingExp
)
self
.
directionPivot
=
directionPivot
@property
def
directionMarginal
(
self
):
return
tuple
([
x
for
x
in
range
(
self
.
npar
)
\
if
x
not
in
self
.
directionPivot
])
@property
def
mu0Pivot
(
self
):
return
checkParameterList
(
self
.
mu0
(
0
,
self
.
directionPivot
),
self
.
nparPivot
)[
0
]
@property
def
mu0Marginal
(
self
):
return
checkParameterList
(
self
.
mu0
(
0
,
self
.
directionMarginal
),
self
.
nparMarginal
)[
0
]
@property
def
nparPivot
(
self
):
return
len
(
self
.
directionPivot
)
@property
def
nparMarginal
(
self
):
return
self
.
npar
-
self
.
nparPivot
@property
def
rescalingExpPivot
(
self
):
return
[
self
.
rescalingExp
[
x
]
for
x
in
self
.
directionPivot
]
@property
def
rescalingExpMarginal
(
self
):
return
[
self
.
rescalingExp
[
x
]
for
x
in
self
.
directionMarginal
]
@property
def
scaleFactorPivot
(
self
):
return
[
self
.
scaleFactor
[
x
]
for
x
in
self
.
directionPivot
]
@property
def
scaleFactorMarginal
(
self
):
return
[
self
.
scaleFactor
[
x
]
for
x
in
self
.
directionMarginal
]
Event Timeline
Log In to Comment