gpflow#
Modules#
- gpflow.base
- gpflow.conditionals
- gpflow.config
- gpflow.covariances
- gpflow.expectations
- gpflow.experimental
- gpflow.inducing_variables
- gpflow.kernels
- gpflow.kullback_leiblers
- gpflow.likelihoods
- gpflow.logdensities
- gpflow.mean_functions
- gpflow.models
- gpflow.monitor
- gpflow.optimizers
- gpflow.posteriors
- gpflow.probability_distributions
- gpflow.quadrature
- gpflow.utilities
Classes#
gpflow.Module#
gpflow.Parameter#
- class gpflow.Parameter(value, *, transform=None, prior=None, prior_on=None, trainable=None, dtype=None, name=None, unconstrained_shape=None, constrained_shape=None, shape=None)[source]#
Bases:
tensorflow_probability.python.util.deferred_tensor.TransformedVariable- Parameters
value (
Union[int,float,Sequence[Any],ndarray[Any,Any],Tensor,Variable,Parameter]) –transform (
Optional[Bijector]) –prior (
Optional[Distribution]) –prior_on (
Union[str,PriorOn,None]) –trainable (
Optional[bool]) –dtype (
Union[dtype,DType,None]) –name (
Optional[str]) –unconstrained_shape (
Optional[Sequence[Optional[int]]]) –constrained_shape (
Optional[Sequence[Optional[int]]]) –shape (
Optional[Sequence[Optional[int]]]) –
- assign(value, use_locking=False, name=None, read_value=True)[source]#
Assigns constrained value to the unconstrained parameter’s variable. It passes constrained value through parameter’s transform first.
Example:
a = Parameter(2.0, transform=tfp.bijectors.Softplus()) b = Parameter(3.0) a.assign(4.0) # `a` parameter to `2.0` value. a.assign(tf.constant(5.0)) # `a` parameter to `5.0` value. a.assign(b) # `a` parameter to constrained value of `b`.
- Parameters
value (
Union[int,float,Sequence[Any],ndarray[Any,Any],Tensor,Variable,Parameter]) – Constrained tensor-like value.use_locking (
bool) – If True, use locking during the assignment.name (
Optional[str]) – The name of the operation to be created.read_value (
bool) – if True, will return something which evaluates to the new value of the variable; if False will return the assign op.
- Return type
Tensor
- log_prior_density()[source]#
Log of the prior probability density of the constrained variable.
- Return type
Tensor
- property trainable: bool#
True if this instance is trainable, else False.
This attribute cannot be set directly. Use
gpflow.set_trainable().- Return type
bool
Functions#
gpflow.default_float#
gpflow.default_int#
gpflow.default_jitter#
gpflow.set_trainable#
- gpflow.set_trainable(model, flag)[source]#
Set trainable flag for all
tf.Variables andgpflow.Parameters in atf.Moduleor collection oftf.Modules.- Parameters
model (
Union[Module,Iterable[Module]]) –flag (
bool) –
- Return type
None