This project contains code for running MCMC Simulations on SpiNNaker. This has been made general, to allow users to add their own MCMC models by providing a few simple components.
-
Create a C header file containing:
- A structure called
struct mcmc_paramswhich contains every fixed parameter that you require. - A structure called
struct mcmc_statewhich contains each state variable that changes during the execution that you require.
An example can be seen in
c_models/mcmc_models/examples/lighthouse/lighthouse.h - A structure called
-
Create a C source file containing and implementation of each of the functions in
c_models/mcmc_models/mcmc_model.hAn example can be seen in
c_models/mcmc_models/examples/lighthouse/lighthouse.c -
Create a Makefile for your C code, which includes your source file. Call
maketo build your code.An example can be seen in
c_models/mcmc_models/examples/lighthouse/Makefile -
Create a Python file containing a class which extends
mcmc.mcmc_model.MCMCModeland implement each of the abstract methods therein.An example can be seen in
mcmc_examples/lighthouse/lighthouse_model.py -
Create a Python script for your example, which calls
mcmc.mcmc_framework.run_mcmc. This returns the results of the simulation.An example can be seen in
mcmc_examples/lighthouse/lighthouse.py