Overview of code for the paper 'long- and short term history effects in a spiking network model of statistical learning'.

All code is written in MATLAB. If something is unclear, please feel free to contact me at amadeus.maes@gmail.com.

Simulations can be started by running the file:
`setup_network_simulation.m`
The networks are constructed in files:
`createUniform.m` (the uniform sampler network)
`createReadOutRNN.m` (the sensory network)
You can choose the parameters of the dynamics, input and plasticity in the files:
`dynamics_parameters.m`
`external_input.p`
`plasticity_parameters.m`
Set the boolean to choose whether you want to run spontaneous dynamics, or to add plasticity and learning:
`spontaneous_simulation.m`
`training_simulation.m` (`compute_error.m` tracks error during learning, plastic weights are saved in data folder)
This file samples from the target distribution to give input to the sensory network (used in `training_simulation.m`):
`sample_target.m`
This file sets the initial connectivity between uniform sampler network and sensory network:
`test_setup.m`
Code to plot spike rasters of the networks are found in:
`plotUNIFORMRASTER.m`
`plotReadOutRASTER.m`
All previous files listed form the 'basics', and are involved with running and training the model.
The following files can be used to analyze the model and make figures.
Run this file to simulate psychometric curves for a certain set time, set distribution in the file `test_setup_exp.m`:
`compute_expectation.m`:
Run this file to compute the mean slope and standard deviation of the curve as a function of simulation time:
`compute_std_simtimes.m`
The following three files can only be ran when you have the data:
`compute_slope.m` (figure 5.A)
`compute_short_term_effect.m` (figure 5.D)
`compute_weight_corrs.m` (suppl fig 3.A)
you can get the data by training the model, initializing the distribution as unimodal or bimodal in `test_setup.m`. Once you have trained the model, and recorded the plastic weights, you can then compute the slope of the psychometric curve with learning, or the short-term effect or the weight correlations. This data is not included because it is a few 100MB large.
Two data files included:
`target_distr2.mat`: hardcoded target distribution (see figure 2.B)
`wRE10_50_100_small_v3_100.mat`: example plastic weights after 500 samples given to sensory network
(this will be different every time you run the model, this one is used for suppl fig 1)