@@ -14,15 +14,15 @@ def _theano_hamiltonian(model_vars, shared, logpt, potential):
1414
1515 Parameters
1616 ----------
17- model_vars: array of variables to be sampled
18- shared theano tensors that are already shared
19- logpt: model log probability
20- potential: hamiltonian potential
17+ model_vars : array of variables to be sampled
18+ shared : theano tensors that are already shared
19+ logpt : model log probability
20+ potential : hamiltonian potential
2121
2222 Returns
2323 -------
24- Hamiltonian: namedtuple with log pdf, gradient of log pdf, and potential functions
25- q: Starting position variable.
24+ Hamiltonian : namedtuple with log pdf, gradient of log pdf, and potential functions
25+ q : Starting position variable.
2626 """
2727 dlogp = gradient (logpt , model_vars )
2828 (logp , dlogp ), q = join_nonshared_inputs ([logpt , dlogp ], model_vars , shared )
@@ -36,14 +36,14 @@ def _theano_energy_function(H, q, **theano_kwargs):
3636
3737 Parameters
3838 ----------
39- H: Hamiltonian namedtuple
40- q: theano variable, starting position
41- theano_kwargs: passed to theano.function
39+ H : Hamiltonian namedtuple
40+ q : theano variable, starting position
41+ theano_kwargs : passed to theano.function
4242
4343 Returns
4444 -------
45- energy_function: theano function that computes the energy at a point (p, q) in phase space
46- p: Starting momentum variable.
45+ energy_function : theano function that computes the energy at a point (p, q) in phase space
46+ p : Starting momentum variable.
4747 """
4848 p = tt .dvector ('p' )
4949 p .tag .test_value = q .tag .test_value
@@ -91,19 +91,19 @@ def get_theano_hamiltonian_functions(model_vars, shared, logpt, potential,
9191 Parameters
9292 ----------
9393 model_vars : array of variables to be sampled
94- shared theano tensors that are already shared
95- logpt: model log probability
96- potential: hamiltonian potential
94+ shared : theano tensors that are already shared
95+ logpt : model log probability
96+ potential : Hamiltonian potential
9797 theano_kwargs : dictionary of keyword arguments to pass to theano functions
98- use_single_leapfrog: Boolean, if only 1 integration step is done at a time (as in NUTS),
99- this provides a ~2x speedup
98+ use_single_leapfrog : Boolean, if only 1 integration step is done at a time (as in NUTS),
99+ this provides a ~2x speedup
100100
101101 Returns
102102 -------
103- H: Hamiltonian namedtuple
104- energy_function: theano function computing energy at a point in phase space
105- leapfrog_integrator: theano function integrating the Hamiltonian from a point in phase space
106- theano_variables: dictionary of variables used in the computation graph which may be useful
103+ H : Hamiltonian namedtuple
104+ energy_function : theano function computing energy at a point in phase space
105+ leapfrog_integrator : theano function integrating the Hamiltonian from a point in phase space
106+ theano_variables : dictionary of variables used in the computation graph which may be useful
107107 """
108108 H , q = _theano_hamiltonian (model_vars , shared , logpt , potential )
109109 energy_function , p = _theano_energy_function (H , q , ** theano_kwargs )
@@ -137,18 +137,18 @@ def leapfrog(H, q, p, epsilon, n_steps):
137137 ----------
138138 H : Hamiltonian instance.
139139 Tuple of `logp, dlogp, potential`.
140- q: Theano.tensor
140+ q : Theano.tensor
141141 initial position vector
142- p: Theano.tensor
142+ p : Theano.tensor
143143 initial momentum vector
144- epsilon: float, step size
145- n_steps: int, number of iterations
144+ epsilon : float, step size
145+ n_steps : int, number of iterations
146146
147147 Returns
148148 -------
149- position: Theano.tensor
149+ position : Theano.tensor
150150 position estimate at time :math:`n \cdot e`.
151- momentum: Theano.tensor
151+ momentum : Theano.tensor
152152 momentum estimate at time :math:`n \cdot e`.
153153 """
154154 def full_update (p , q ):
0 commit comments