# HG changeset patch # User gdesjardins # Date 1292886484 18000 # Node ID 746ebceeb46f25eb53b7fb0d61fe1ed360ea1216 # Parent c82340966bf661aab90ba1a0cbe8eb5d146db669 added comments to hmc code (old outstanding changes) diff -r c82340966bf6 -r 746ebceeb46f pylearn/sampling/hmc.py --- a/pylearn/sampling/hmc.py Mon Dec 20 17:59:49 2010 -0500 +++ b/pylearn/sampling/hmc.py Mon Dec 20 18:08:04 2010 -0500 @@ -132,6 +132,12 @@ non_sequences=[stepsize], n_steps=n_steps-1) + # NOTE: Scan always returns an updates dictionary, in case the scanned function draws + # samples from a RandomStream. These updates must then be used when compiling the Theano + # function, to avoid drawing the same random numbers each time the function is called. In + # this case however, we consciously ignore "scan_updates" because we know it is empty. + assert not scan_updates + # The last velocity returned by the scan op is at time-step: t + n_steps* stepsize - 1/2 # We therefore perform one more half-step to return vel(t + n_steps*stepsize) energy = energy_fn(final_p)