This constitutes the majority of the work on my masters project, entitled "Biologically Motivated Reinforcement Learning in Spiking Neural Networks."
The code doesn't follow PEP8 guidelines and is unsafely written with star imports. The project structure is as follows (in order of imports):
parameters_shared.pyis the root of all the files, in which parameters shared for both the spiking and rate-based models are kept.parameters_spiking.pyimports fromparameters_shared.pyand ends the chain of import for the spiking model code.parameters.pycontains the parameters and some helpful constructs, including prespecified learning rules and vectorisations of the network parameters. It inherits fromparameters_shared.pyfor many of these constructions.functions.pybegins the functionality of the rate-based model. It inheritsparameters.pyand specifiesnumba.jited functions for fast computation of the rate-based model.simulation.pyinherits fromfunctions.pyand describes the simulations which will be run as tasks. Effectively it brings the functions infunctions.pytogether into cohesive units.evolution.pyends the chain, inheriting fromsimulation.py. Here, classes and functions useful for the evolutionary algorithm are defined.
Aside from these .py files mentioned, there are also several scripts which run various evolutionary tasks, test stability of the code, or plot the plots of the thesis. There may remain some .ipynb Jupyter notebooks which were used originally in creating the plots or fitting some functions. They were not updated as the previous files were and as such are fairly untidy.
Many of the scripts require the presence of a folder named experiments and/or a folder named images_and_animations. Neither of these folders are automatically created, but are used to store the plots and results of various functions.
Finally, the fitted version of the firing rate function, phi_fitted in functions.py depends on fitted parameters. Because these parameters are loaded outside the function and within the scope of downstream imports, unless those parameters are provided as .npy files, the code wil not run. These can be generated using the final method in Approximating-Phi.ipynb.