hasty-hamiltonian: Speedy traversal through parameter space.
Gradient-based traversal through parameter space.
This implementation of the HMC algorithm uses
lens as a means to operate over
generic indexed traversable functors, so you can expect it to work if your
target function takes a list, vector, map, sequence, etc. as its argument.
If you don't want to calculate your gradients by hand you can use the handy ad library for automatic differentiation.
mcmc function that prints a trace to stdout, a
for collecting results in memory, and a
hamiltonian transition operator
that can be used more generally.
import Numeric.AD (grad) import Numeric.MCMC.Hamiltonian target :: RealFloat a => [a] -> a target [x0, x1] = negate ((x0 + 2 * x1 - 7) ^ 2 + (2 * x0 + x1 - 5) ^ 2) gTarget :: [Double] -> [Double] gTarget = grad target booth :: Target [Double] booth = Target target (Just gTarget) main :: IO () main = withSystemRandom . asGenIO $ mcmc 10000 0.05 20 [0, 0] booth
|Versions [faq]||1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.2.0, 1.3.0, 1.3.2|
|Dependencies||base (>=4 && <6), kan-extensions (==5.*), lens (==4.*), mcmc-types (>=1.0.1), mwc-probability (>=2.0 && <3), pipes (==4.*), primitive (>=0.5 && <1.0), transformers (>=0.5 && <1.0) [details]|
|Revised||Revision 1 made by JaredTobin at Fri Sep 13 23:56:34 UTC 2019|
|Source repo||head: git clone http://github.com/jtobin/hasty-hamiltonian.git|
|Uploaded||by JaredTobin at Wed Mar 14 22:05:04 UTC 2018|
|Distributions||LTSHaskell:1.3.2, NixOS:1.3.2, Stackage:1.3.2|
|Downloads||3058 total (187 in the last 30 days)|
|Rating||(no votes yet) [estimated by rule of succession]|
Docs available [build log]
Last success reported on 2018-03-14 [all 1 reports]
- hasty-hamiltonian-1.3.2.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
For package maintainers and hackage trustees