Skip to content

Commit 4532cd8

Browse files
committed
refine docs
1 parent 04564bc commit 4532cd8

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

python/paddle/distribution/continuous_bernoulli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ class ContinuousBernoulli(distribution.Distribution):
5454
`probability` will be convert to a 1-D Tensor the paddle global default dtype.
5555
eps(float): Specify the bandwith of the unstable calculation region near 0.5. The unstable calculation region
5656
would be [0.5 - eps, 0.5 + eps], where the calculation is approximated by talyor expansion. The
57-
default value is 1e-4.
57+
default value is 0.02.
5858
5959
Examples:
6060
.. code-block:: python
@@ -277,7 +277,7 @@ def log_prob(self, value):
277277
value (Tensor): The input tensor.
278278
279279
Returns:
280-
Tensor: log probability. The data type is same with :attr:`value` .
280+
Tensor: log probability. The data type is the same as `self.probability`.
281281
"""
282282
value = paddle.cast(value, dtype=self.dtype)
283283
if not self._check_constraint(value):
@@ -299,7 +299,7 @@ def prob(self, value):
299299
value (Tensor): The input tensor.
300300
301301
Returns:
302-
Tensor: probability. The data type is same with :attr:`value` .
302+
Tensor: probability. The data type is the same as `self.probability`.
303303
"""
304304
return paddle.exp(self.log_prob(value))
305305

@@ -352,7 +352,7 @@ def cdf(self, value):
352352
value (Tensor): The input tensor.
353353
354354
Returns:
355-
Tensor: quantile of :attr:`value`. The data type is same with :attr:`value` .
355+
Tensor: quantile of :attr:`value`. The data type is the same as `self.probability`.
356356
"""
357357
value = paddle.cast(value, dtype=self.dtype)
358358
if not self._check_constraint(value):
@@ -396,7 +396,7 @@ def icdf(self, value):
396396
value (Tensor): The input tensor, meaning the quantile.
397397
398398
Returns:
399-
Tensor: the value of the r.v. corresponding to the quantile. The data type is same with :attr:`value` .
399+
Tensor: the value of the r.v. corresponding to the quantile. The data type is the same as `self.probability`.
400400
"""
401401
value = paddle.cast(value, dtype=self.dtype)
402402
if not self._check_constraint(value):

python/paddle/distribution/multivariate_normal.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def sample(self, shape=()):
283283
shape (Sequence[int], optional): Prepended shape of the generated samples.
284284
285285
Returns:
286-
Tensor, Sampled data with shape `sample_shape` + `batch_shape` + `event_shape`. The data type is the global default dtype.
286+
Tensor, Sampled data with shape `sample_shape` + `batch_shape` + `event_shape`. The data type is the same as `self.loc`.
287287
"""
288288
with paddle.no_grad():
289289
return self.rsample(shape)
@@ -295,7 +295,7 @@ def rsample(self, shape=()):
295295
shape (Sequence[int], optional): Prepended shape of the generated samples.
296296
297297
Returns:
298-
Tensor, Sampled data with shape `sample_shape` + `batch_shape` + `event_shape`. The data type is the global default dtype.
298+
Tensor, Sampled data with shape `sample_shape` + `batch_shape` + `event_shape`. The data type is the same as `self.loc`.
299299
"""
300300
if not isinstance(shape, Sequence):
301301
raise TypeError('sample shape must be Sequence object.')
@@ -312,7 +312,7 @@ def log_prob(self, value):
312312
value (Tensor): The input tensor.
313313
314314
Returns:
315-
Tensor: log probability. The data type is same with :attr:`value` .
315+
Tensor: log probability. The data type is the same as `self.loc`.
316316
"""
317317
value = paddle.cast(value, dtype=self.dtype)
318318

@@ -335,7 +335,7 @@ def prob(self, value):
335335
value (Tensor): The input tensor.
336336
337337
Returns:
338-
Tensor: probability. The data type is same with :attr:`value` .
338+
Tensor: probability. The data type is the same as `self.loc`.
339339
"""
340340
return paddle.exp(self.log_prob(value))
341341

@@ -353,7 +353,7 @@ def entropy(self):
353353
* :math:\Omega: is the support of the distribution.
354354
355355
Returns:
356-
Tensor, Shannon entropy of Multivariate Normal distribution. The data type is the global default dtype.
356+
Tensor, Shannon entropy of Multivariate Normal distribution. The data type is the same as `self.loc`.
357357
"""
358358
half_log_det = (
359359
self._unbroadcasted_scale_tril.diagonal(axis1=-2, axis2=-1)
@@ -382,7 +382,7 @@ def kl_divergence(self, other):
382382
other (MultivariateNormal): instance of Multivariate Normal.
383383
384384
Returns:
385-
Tensor, kl-divergence between two Multivariate Normal distributions. The data type is the global default dtype.
385+
Tensor, kl-divergence between two Multivariate Normal distributions. The data type is the same as `self.loc`.
386386
387387
"""
388388
if (

0 commit comments

Comments
 (0)