def initialize(self, dtype=tf.float64):
if self.tf_mean is None:
if self.mean is not None:
self.tf_mean = tf.Variable(self.mean, dtype=dtype)
else:
self.tf_mean = tf.Variable(tf.cast(tf.fill([self.dims], 0.0), dtype))
if self.tf_covariance is None:
if self.covariance is not None:
self.tf_covariance = self.covariance
else:
self.tf_covariance = FullCovariance(self.dims)
self.tf_covariance.initialize(dtype)
if self.tf_ln2piD is None:
self.tf_ln2piD = tf.constant(np.log(2 * np.pi) * self.dims, dtype=dtype)
gaussian_distribution.py 文件源码
python
阅读 32
收藏 0
点赞 0
评论 0
评论列表
文章目录