This readme and the code was taken from the first authors github repository:

This is the code necessary to reproduce all major figures for Cayco-Gajic, Clopath & Silver 2017, "Sparse synaptic connectivity is required for decorrelation and pattern separation in feedforward networks."

Getting started
This repo contains both Matlab and Python code. In general, the Matlab scripts are designed to be run locally and Python scripts to be run on a cluster. All simulations require pre-generated network connectivities and input statistics, which are used by both the analytical and biophysical models. These can either be generated from scratch (see below) or the example pre-generated files (which are already in the network_structures and input_statistics folders) can be used.
To generate new network connectivities, use:
To change input statistics, use:
This requires the Dichotomized Gaussian tools from the Macke Lab in order to generate spike trains with arbitrary correlations. See:

For the analytical model, simulations are done within the .m plotting files, or within the .py file for backpropagation. On the other hand, the biophysical model must be simulated on a cluster prior to analysing the patterns. First the parameters must be initalized via:
This creates the file params_file.pkl, which is used to run array jobs on an external cluster (skip this step if using pre-simulated data). After initialization, the following script simulates the model:
This saves the GC and MF spike times as .dat files for each simulation. To save memory, after finishing the simulations run the following code and then remove the .dat files:
This converts the spike times to spike count activity patterns, which are used in all analyses.
Note that simulating the biophysical model requires NeuroML2, jNeuroML, and pyNeuroML ( The folder grc_lemsDefinitions includes NeuroML2 and XML files necessary to run the biophysical model.

Activity pattern properties (variance, covariance, population sparseness) can be computed using the following code:
To run backpropagation, use either:
For the analytical model, the .m files above will automatically produce relevant plots. For the biophysical model, after running the above .py files, use: