Skip to content

Commit 6bc8b67

Browse files
committed
[no ci] docs: formatting in docstrings
1 parent 68bd41e commit 6bc8b67

File tree

13 files changed

+37
-23
lines changed

13 files changed

+37
-23
lines changed

bayesflow/approximators/approximator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ def fit(self, *, dataset: keras.utils.PyDataset = None, simulator: Simulator = N
7474
A simulator used to generate a dataset. If provided, `dataset` must be None.
7575
**kwargs : dict
7676
Additional keyword arguments passed to `keras.Model.fit()`, including (see also `build_dataset`):
77+
7778
batch_size : int or None, default='auto'
7879
Number of samples per gradient update. Do not specify if `dataset` is provided as a
7980
`keras.utils.PyDataset`, `tf.data.Dataset`, `torch.utils.data.DataLoader`, or a generator function.

bayesflow/approximators/continuous_approximator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ def fit(self, *args, **kwargs):
124124
A simulator used to generate a dataset. If provided, `dataset` must be None.
125125
**kwargs : dict
126126
Additional keyword arguments passed to `keras.Model.fit()`, including (see also `build_dataset`):
127+
127128
batch_size : int or None, default='auto'
128129
Number of samples per gradient update. Do not specify if `dataset` is provided as a
129130
`keras.utils.PyDataset`, `tf.data.Dataset`, `torch.utils.data.DataLoader`, or a generator function.

bayesflow/diagnostics/metrics/calibration_error.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def calibration_error(
4646
-------
4747
result : dict
4848
Dictionary containing:
49+
4950
- "values" : float or np.ndarray
5051
The aggregated calibration error per variable
5152
- "metric_name" : str

bayesflow/diagnostics/metrics/posterior_contraction.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def posterior_contraction(
3434
-------
3535
result : dict
3636
Dictionary containing:
37+
3738
- "values" : float or np.ndarray
3839
The aggregated posterior contraction per variable
3940
- "metric_name" : str

bayesflow/diagnostics/metrics/root_mean_squared_error.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ def root_mean_squared_error(
4242
-------
4343
result : dict
4444
Dictionary containing:
45+
4546
- "values" : np.ndarray
4647
The aggregated (N)RMSE for each variable.
4748
- "metric_name" : str

bayesflow/diagnostics/plots/pairs_posterior.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ def pairs_posterior(
3030
) -> sns.PairGrid:
3131
"""Generates a bivariate pair plot given posterior draws and optional prior or prior draws.
3232
33+
Parameters
34+
----------
3335
estimates : np.ndarray of shape (n_post_draws, n_params)
3436
The posterior draws obtained for a SINGLE observed data set.
3537
targets : np.ndarray of shape (n_params,) or None, optional, default: None

bayesflow/networks/consistency_models/consistency_model.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ def __init__(
5959
instantiated using subnet_kwargs.
6060
max_time : int or float, optional, default: 200.0
6161
The maximum time of the diffusion
62-
sigma2 : float or Tensor of dimension (input_dim, 1),
63-
optional, default: 1.0
62+
sigma2 : float or Tensor of dimension (input_dim, 1), optional, default: 1.0
6463
Controls the shape of the skip-function
6564
eps : float, optional, default: 0.001
6665
The minimum time

bayesflow/utils/jacobian/jacobian.py

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,22 @@ def jacobian(f: Callable[[Tensor], Tensor], x: Tensor, return_output: bool = Fal
1212
"""
1313
Compute the Jacobian matrix of f with respect to x.
1414
15-
:param f: The function to be differentiated.
16-
17-
:param x: Tensor of shape (..., D_in)
15+
Parameters
16+
----------
17+
f : callable
18+
The function to be differentiated.
19+
x : Tensor of shape (..., D_in)
1820
The input tensor to f.
19-
20-
:param return_output: bool
21+
return_output : bool, optional
2122
Whether to return the output of f(x) along with the Jacobian matrix.
2223
Default: False
2324
24-
:return: Tensor of shape (..., D_out, D_in)
25+
Returns
26+
-------
27+
Tensor of shape (..., D_out, D_in)
2528
The Jacobian matrix of f with respect to x.
2629
27-
:return: 2-tuple of tensors:
30+
2-tuple of tensors
2831
1. The output of f(x) (if return_output is True)
2932
2. Tensor of shape (..., D_out, D_in)
3033
The Jacobian matrix of f with respect to x.

bayesflow/utils/jacobian/jacobian_trace.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,27 @@ def jacobian_trace(
1616
):
1717
"""Compute or estimate the trace of the Jacobian matrix of f.
1818
19-
:param f: The function to be differentiated.
20-
21-
:param x: Tensor of shape (n, ..., d)
19+
Parameters
20+
----------
21+
f : callable
22+
The function to be differentiated.
23+
x : Tensor of shape (n, ..., d)
2224
The input tensor to f.
23-
24-
:param max_steps: The maximum number of steps to use for the estimate.
25+
max_steps : int, optional
26+
The maximum number of steps to use for the estimate.
2527
If this does not exceed the dimensionality of f(x), use Hutchinson's algorithm to
2628
return an unbiased estimate of the Jacobian trace.
2729
Otherwise, perform an exact computation.
2830
Default: None
29-
30-
:param return_output: bool
31+
return_output : bool, optional
3132
Whether to return the output of f(x) along with the trace of the Jacobian.
3233
Default: False
33-
34-
:param seed: int or keras SeedGenerator
34+
seed : int or keras SeedGenerator, optional
3535
The seed to use for hutchinson trace estimation. Only has an effect when max_steps < d.
3636
37-
:return: 2-tuple of tensors:
37+
Returns
38+
-------
39+
2-tuple of tensors:
3840
1. The output of f(x) (if return_output is True)
3941
2. Tensor of shape (n,)
4042
An unbiased estimate or the exact trace of the Jacobian of f.

bayesflow/utils/plot_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ def prepare_plot_data(
2727
----------
2828
estimates : dict[str, ndarray] or ndarray
2929
The model-generated predictions or estimates, which can take the following forms:
30+
3031
- ndarray of shape (num_datasets, num_variables)
3132
Point estimates for each dataset, where `num_datasets` is the number of datasets
3233
and `num_variables` is the number of variables per dataset.

0 commit comments

Comments
 (0)