romcomma.gsa.calibrators.ClosedSobol§
- class ClosedSobol(gp, **kwargs)[source]§
Bases:
Module
,Calibrator
Calculates closed Sobol Indices.
- Parameters:
gp (GPR) –
kwargs (Any) –
- __init__(gp, **kwargs)[source]§
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
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.
Returns: An empty dictionary.
- 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.
- 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.