b0ddc6d1632f63632583ea70caca678fce3696f3,gpflow/models/model.py,BayesianModel,log_prior,#BayesianModel#,39
Before Change
return -(self.log_likelihood(*args, **kwargs) + self.log_prior())
def log_prior(self) -> tf.Tensor:
if len(self.variables) == 0:
return tf.convert_to_tensor(0., dtype=default_float())
return tf.add_n([p.log_prior() for p in self.trainable_parameters])
@abc.abstractmethod
def log_likelihood(self, *args, **kwargs) -> tf.Tensor:
After Change
def log_prior(self) -> tf.Tensor:
log_priors = [p.log_prior() for p in self.trainable_parameters]
if log_priors:
return tf.add_n(log_priors)
else:
return tf.convert_to_tensor(0., dtype=default_float())
@abc.abstractmethod
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: GPflow/GPflow
Commit Name: b0ddc6d1632f63632583ea70caca678fce3696f3
Time: 2019-10-21
Author: st--@users.noreply.github.com
File Name: gpflow/models/model.py
Class Name: BayesianModel
Method Name: log_prior
Project Name: reinforceio/tensorforce
Commit Name: 02fb71f730f6e600edbf27f58cea86209cb5dc55
Time: 2017-10-15
Author: aok25@cl.cam.ac.uk
File Name: tensorforce/core/networks/layer.py
Class Name: Linear
Method Name: tf_regularization_losses
Project Name: tensorflow/kfac
Commit Name: aa5f9ddfdf0447c7a53f4e2676a1c866189315cd
Time: 2019-02-01
Author: jamesmartens@google.com
File Name: kfac/python/ops/curvature_matrix_vector_products.py
Class Name: CurvatureMatrixVectorProductComputer
Method Name: _total_loss