Skip to content

Commit fc63e84

Browse files
Made changes to smc.py and sample_smc.py for pr#6114
1 parent adf7359 commit fc63e84

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

docs/source/api/smc.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ Sequential Monte Carlo
88

99
sample_smc
1010

11-
(smc_kernels)=
11+
.. _smc_kernels:
12+
1213
SMC kernels
1314
-----------
1415

pymc/smc/smc.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
class SMC_KERNEL(ABC):
4444
"""Base class for the Sequential Monte Carlo kernels.
4545
46-
To create a new kernel you should subclass from this.
46+
To create a new SMC kernel you should subclass from this.
4747
4848
Before sampling, the following methods are called once in order:
4949
@@ -132,6 +132,7 @@ def __init__(
132132
threshold=0.5,
133133
):
134134
"""
135+
Initialize the SMC_kernel class.
135136
136137
Parameters
137138
----------
@@ -149,6 +150,11 @@ def __init__(
149150
the higher the value of `threshold` the higher the number of stages. Defaults to 0.5.
150151
It should be between 0 and 1.
151152
153+
Attributes
154+
----------
155+
self.var_info : dict
156+
Dictionary that contains information about model variables shape and size.
157+
152158
"""
153159

154160
self.draws = draws

pymc/variational/inference.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ class Inference:
4949
5050
Parameters
5151
----------
52-
op: Operator class
53-
approx: Approximation class or instance
54-
tf: TestFunction instance
55-
model: Model
52+
op : Operator class #:class:`~pymc.variational.operators`
53+
approx : Approximation class or instance #:class:`~pymc.variational.approximations`
54+
tf : TestFunction instance #?
55+
model : Model
5656
PyMC Model
57-
kwargs: kwargs passed to :class:`Operator`
57+
kwargs : kwargs passed to :class:`Operator` #:class:`~pymc.variational.operators`, optional
5858
"""
5959

6060
def __init__(self, op, approx, tf, **kwargs):
@@ -96,18 +96,18 @@ def fit(self, n=10000, score=None, callbacks=None, progressbar=True, **kwargs):
9696
9797
Parameters
9898
----------
99-
n: int
99+
n : int
100100
number of iterations
101-
score: bool
101+
score : bool
102102
evaluate loss on each iteration or not
103-
callbacks: list[function: (Approximation, losses, i) -> None]
103+
callbacks : list[function: (Approximation, losses, i) -> None]
104104
calls provided functions after each iteration step
105-
progressbar: bool
105+
progressbar : bool
106106
whether to show progressbar or not
107107
108108
Other Parameters
109109
----------------
110-
obj_n_mc: `int`
110+
obj_n_mc: int
111111
Number of monte carlo samples used for approximation of objective gradients
112112
tf_n_mc: `int`
113113
Number of monte carlo samples used for approximation of test function gradients

0 commit comments

Comments
 (0)