romcomma.gsa.calibrators.ClosedSobolWithError§
- class ClosedSobolWithError(gp, **kwargs)[source]§
Bases:
ClosedSobol
Calculates closed Sobol Indices with Errors.
- Parameters:
gp (GPR) –
kwargs (Any) –
- __init__(gp, **kwargs)§
Construct a ClosedSobol object. A wide range of values are collected or calculated and cached, especially via the final call to self._calibrate.
- Parameters:
gp (GPR) – The gp to analyze.
**kwargs (Any) – The calculation meta to override META.
Methods
__init__
(gp, **kwargs)Construct a ClosedSobol object.
marginalize
(m)Calculate everything.
with_name_scope
(method)Decorator to automatically enter the module name scope.
Attributes
RANK_EQUATIONS
Returns the name of this module as passed or determined in the ctor.
Returns a tf.name_scope instance for this class.
Sequence of non-trainable variables owned by this module and its submodules.
parameters
Sequence of all sub-modules.
trainable_parameters
Sequence of trainable variables owned by this module and its submodules.
Sequence of variables owned by this module and its submodules.
- class property META: Dict[str, Any]§
Default calculation meta.
is_T_partial
forces W[Mm] = W[MM] = 0.- Returns:
If True this effectively asserts the full [‘M’] model is variance free, so WmM is not calculated or returned.
- Return type:
is_T_partial
- class RankEquation(l, i, j, k)[source]§
Bases:
NamedTuple
- Parameters:
l (str) –
i (str) –
j (str) –
k (str) –
- l: str§
Alias for field number 0
- i: str§
Alias for field number 1
- j: str§
Alias for field number 2
- k: str§
Alias for field number 3
- count(value, /)§
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)§
Return first index of value.
Raises ValueError if the value is not present.
- class RankEquations(DIAGONAL, MIXED)[source]§
Bases:
NamedTuple
- Parameters:
DIAGONAL (Any) –
MIXED (Any) –
- DIAGONAL: Any§
Alias for field number 0
- MIXED: Any§
Alias for field number 1
- count(value, /)§
Return number of occurrences of value.
- index(value, start=0, stop=9223372036854775807, /)§
Return first index of value.
Raises ValueError if the value is not present.
- marginalize(m)[source]§
Calculate everything. :param m: A Tf.Tensor pair of ints indicating the slice [m[0]:m[1]].
Returns: The Sobol ClosedSobol of m, with errors (T and W).
- Parameters:
m (TF.Slice) –
- Return type:
Dict[str:TF.Tensor]
- property name§
Returns the name of this module as passed or determined in the ctor.
NOTE: This is not the same as the self.name_scope.name which includes parent module names.
- property name_scope§
Returns a tf.name_scope instance for this class.
- property non_trainable_variables§
Sequence of non-trainable variables owned by this module and its submodules.
Note: this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don’t expect the return value to change.
- Returns:
A sequence of variables for the current module (sorted by attribute name) followed by variables from all submodules recursively (breadth first).
- property submodules§
Sequence of all sub-modules.
Submodules are modules which are properties of this module, or found as properties of modules which are properties of this module (and so on).
>>> a = tf.Module() >>> b = tf.Module() >>> c = tf.Module() >>> a.b = b >>> b.c = c >>> list(a.submodules) == [b, c] True >>> list(b.submodules) == [c] True >>> list(c.submodules) == [] True
- Returns:
A sequence of all submodules.
- property trainable_variables§
Sequence of trainable variables owned by this module and its submodules.
Note: this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don’t expect the return value to change.
- Returns:
A sequence of variables for the current module (sorted by attribute name) followed by variables from all submodules recursively (breadth first).
- property variables§
Sequence of variables owned by this module and its submodules.
Note: this method uses reflection to find variables on the current instance and submodules. For performance reasons you may wish to cache the result of calling this method if you don’t expect the return value to change.
- Returns:
A sequence of variables for the current module (sorted by attribute name) followed by variables from all submodules recursively (breadth first).
- classmethod with_name_scope(method)§
Decorator to automatically enter the module name scope.
>>> class MyModule(tf.Module): ... @tf.Module.with_name_scope ... def __call__(self, x): ... if not hasattr(self, 'w'): ... self.w = tf.Variable(tf.random.normal([x.shape[1], 3])) ... return tf.matmul(x, self.w)
Using the above module would produce `tf.Variable`s and `tf.Tensor`s whose names included the module name:
>>> mod = MyModule() >>> mod(tf.ones([1, 2])) <tf.Tensor: shape=(1, 3), dtype=float32, numpy=..., dtype=float32)> >>> mod.w <tf.Variable 'my_module/Variable:0' shape=(2, 3) dtype=float32, numpy=..., dtype=float32)>
- Parameters:
method – The method to wrap.
- Returns:
The original method wrapped such that it enters the module’s name scope.