gpflow.config#
This is a private module that manages GPflow configuration.
The module provides functions to modify default settings of GPflow, such as: - the standard float precision and integer type - the type of positive transformation - a value for a minimum shift from zero for the positive transformation - an output format for gpflow.utilities.print_summary
The module holds global configuration Config
variable that stores all
setting values.
Environment variables are an alternative way for changing the default GPflow configuration.
Warning
The user has to set environment variables before running python interpreter to modify the configuration.
Full set of environment variables and available options:
GPFLOW_INT
: “int16”, “int32”, or “int64”GPFLOW_FLOAT
: “float16”, “float32”, or “float64”GPFLOW_POSITIVE_BIJECTOR
: “exp” or “softplus”GPFLOW_POSITIVE_MINIMUM
: Any positive float numberGPFLOW_SUMMARY_FMT
: “notebook” or any other format thattabulate
can handle.GPFLOW_JITTER
: Any positive float number
The user can also change the GPflow configuration temporarily with a context
manager as_context()
:
>>> config = Config(jitter=1e-5)
>>> with as_context(config):
>>> # ...code here sees new config
Classes#
gpflow.config.Config#
- class gpflow.config.Config(int=<factory>, float=<factory>, jitter=<factory>, positive_bijector=<factory>, positive_minimum=<factory>, summary_fmt=<factory>)[source]#
Bases:
object
Immutable object for storing global GPflow settings
- Parameters:
- float: type#
Float data type, float32 or float64
- int: type#
Integer data type, int32 or int64.
- jitter: float#
Jitter value. Mainly used for for making badly conditioned matrices more stable.
Default value is 1e-6.
- positive_bijector: str#
Method for positive bijector, either “softplus” or “exp”.
Default is “softplus”.
- positive_minimum: float#
Lower bound for the positive transformation.
- summary_fmt: Optional[str]#
Summary format for module printing.
Functions#
gpflow.config.as_context#
gpflow.config.config#
gpflow.config.default_positive_bijector#
gpflow.config.default_positive_minimum#
gpflow.config.default_summary_fmt#
gpflow.config.positive_bijector_type_map#
gpflow.config.set_config#
gpflow.config.set_default_float#
gpflow.config.set_default_int#
gpflow.config.set_default_jitter#
- gpflow.config.set_default_jitter(value)[source]#
Sets constant jitter value. The jitter is a constant that GPflow adds to the diagonal of matrices to achieve numerical stability of the system when the condition number of the associated matrices is large, and therefore the matrices nearly singular.
- Parameters:
value (
float
) –- Return type:
None