gpflow.config

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

Args:

int: Integer data type, int32 or int64. float: Float data type, float32 or float64 jitter: Jitter value. Mainly used for for making badly conditioned matrices more stable.

Default value is 1e-6.

positive_bijector: Method for positive bijector, either “softplus” or “exp”.

Default is “softplus”.

positive_minimum: Lower bound for the positive transformation. summary_fmt: Summary format for module printing.

Parameters
  • int (type) –

  • float (type) –

  • jitter (float) –

  • positive_bijector (str) –

  • positive_minimum (float) –

  • summary_fmt (str) –

gpflow.config.as_context

gpflow.config.as_context(temporary_config=None)[source]

Ensure that global configs defaults, with a context manager. Useful for testing.

Parameters

temporary_config (Optional[Config]) –

gpflow.config.config

gpflow.config.config()[source]

Returns current active config.

Return type

Config

gpflow.config.default_positive_bijector

gpflow.config.default_positive_bijector()[source]

Type of bijector used for positive constraints: exp or softplus.

gpflow.config.default_positive_minimum

gpflow.config.default_positive_minimum()[source]

Shift constant that GPflow adds to all positive constraints.

gpflow.config.positive_bijector_type_map

gpflow.config.positive_bijector_type_map()[source]
Return type

Dict[str, type]

gpflow.config.set_config

gpflow.config.set_config(new_config)[source]

Update GPflow config with new settings from new_config.

Parameters

new_config (Config) –

gpflow.config.set_default_float

gpflow.config.set_default_float(value_type)[source]

Sets default float type. Available options are np.float16, np.float32, or np.float64.

gpflow.config.set_default_int

gpflow.config.set_default_int(value_type)[source]

Sets default integer type. Available options are np.int16, np.int32, or np.int64.

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) –

gpflow.config.set_default_positive_bijector

gpflow.config.set_default_positive_bijector(value)[source]

Sets positive bijector type. There are currently two options implemented: “exp” and “softplus”.

Parameters

value (str) –

gpflow.config.set_default_positive_minimum

gpflow.config.set_default_positive_minimum(value)[source]

Sets shift constant for positive transformation.

Parameters

value (float) –

gpflow.config.set_default_summary_fmt

gpflow.config.set_default_summary_fmt(value)[source]
Parameters

value (str) –