Skip to content

Commit 5049b84

Browse files
committed
Remove deprecation warning about scan.
1 parent 963bd2f commit 5049b84

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

code/mcrbm/hmc.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,14 +144,15 @@ def leapfrog(pos, vel, step):
144144

145145
# perform leapfrog updates: the scan op is used to repeatedly compute
146146
# vel(t + (m-1/2)*stepsize) and pos(t + m*stepsize) for m in [2,n_steps].
147-
(final_pos, final_vel), scan_updates = theano.scan(leapfrog,
147+
(all_pos, all_vel), scan_updates = theano.scan(leapfrog,
148148
outputs_info=[
149-
dict(initial=pos_full_step, return_steps=1),
150-
dict(initial=vel_half_step, return_steps=1),
149+
dict(initial=pos_full_step),
150+
dict(initial=vel_half_step),
151151
],
152152
non_sequences=[stepsize],
153153
n_steps=n_steps-1)
154-
154+
final_pos = all_pos[-1]
155+
final_vel = all_vel[-1]
155156
# NOTE: Scan always returns an updates dictionary, in case the scanned function draws
156157
# samples from a RandomStream. These updates must then be used when compiling the Theano
157158
# function, to avoid drawing the same random numbers each time the function is called. In

0 commit comments

Comments
 (0)