f3c511060ce62072a34a50319237d28b82d10448,gpflow/base.py,Parameter,__init__,#,88

Before Change


        self.prior = prior
        self.prior_on = prior_on  // type: ignore  // see https://github.com/python/mypy/issues/3004

        if isinstance(value, tf.Variable):
            self._unconstrained = value
        else:
            unconstrained_value = self.validate_unconstrained_value(value, dtype)
            self._unconstrained = tf.Variable(
                unconstrained_value, dtype=dtype, name=name, trainable=trainable
            )

    def log_prior_density(self) -> tf.Tensor:
         Log of the prior probability density of the constrained variable. 

        if self.prior is None:

After Change


        therefore we need a positive constraint and it is natural to use constrained values.
        A prior can be imposed either on the constrained version (default) or on the unconstrained version of the parameter.
        
        if transform is None:
            transform = tfp.bijectors.Identity()

        value = _cast_to_dtype(value, dtype)
        _validate_unconstrained_value(value, transform, dtype)
        super().__init__(value, transform, dtype=value.dtype, trainable=trainable, name=name)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: GPflow/GPflow
Commit Name: f3c511060ce62072a34a50319237d28b82d10448
Time: 2020-08-27
Author: dutordoirv@gmail.com
File Name: gpflow/base.py
Class Name: Parameter
Method Name: __init__


Project Name: PetrochukM/PyTorch-NLP
Commit Name: 44f80b5872b1bb9679d15b8230c1731fd26ac527
Time: 2018-03-10
Author: petrochukm@gmail.com
File Name: torchnlp/text_encoders/static_tokenizer_encoder.py
Class Name: StaticTokenizerEncoder
Method Name: __init__


Project Name: keras-team/keras
Commit Name: ecbf73f72b59f8f5c8746de63270aa1fb3ad7524
Time: 2018-10-01
Author: gabrieldemarmiesse@gmail.com
File Name: keras/callbacks.py
Class Name: TensorBoard
Method Name: on_epoch_end


Project Name: GPflow/GPflow
Commit Name: 8c65ef658930afecb7001ce671f15772a0a4b23b
Time: 2020-08-17
Author: art.art.v@gmail.com
File Name: gpflow/base.py
Class Name: Parameter
Method Name: __init__