Code
- All code is released without warranty under the terms of the GNU General Public
License version 2. Please report bugs to michael.spratling@kcl.ac.uk.
- If you make use of any of the following code, please cite the corresponding paper listed below.
- For instructions on using each set of code please refer to the README file provided within the zip file.
dim_patchmatching.zip (1st release: September 2019; Last release: September 2019)
MATLAB code for finding matching image patches. This code performs the experiments described in: M. W. Spratling (2020) Explaining Away Results in Accurate and Tolerant Template Matching. Pattern Recognition, 104 (107337).
pc_biological_fit.zip (1st release: June 2018; Last release: June 2018)
MATLAB code for simulating the response properties of V1 mismatch neurons and for testing the ability of predictive coding algorithms to scale. This code performs the experiments described in: M. W. Spratling (2019) Fitting predictive coding to the neurophysiological data. Brain Research, 1720: 146313.
pcbc_gaze.zip (1st release: May 2017; Last release: May 2017)
MATLAB code for simulating a variety of behavioural and physiological phenomena related to gaze control with the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2017) A predictive coding model of gaze shifts and the underlying neurophysiology. Visual Cognition, 25(7-8): 770-801.
pcbc_image_recognition.zip (1st release: Dec 2016; Last release: Dec 2016)
MATLAB code for performing object recognition with the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2017) A hierarchical predictive coding model of object recognition in natural images. Cognitive Computation, 9(2): 151-67.
pcbc_prob.zip (1st release: Sept 2016; Last release: Sept 2016)
MATLAB code for performing Bayesian inference using the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2016) A neural implementation of Bayesian inference based on predictive coding. Connection Science, 28(4):346-83.
pcbc_cognition.zip (1st release: April 2016; Last release: April 2016)
MATLAB code for simulating a variety of cognitive processes using the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2016) Predictive coding as a model of cognition. Cognitive Processing, 17(3), 279-305.
pcbc_hough.zip (1st release: May 2016; Last release: May 2016)
MATLAB code for performing Hough voting using the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2016) A neural implementation of the Hough transform and the advantages of explaining away. Image and Vision Computing, 52:15-24.
sparse_classification.zip (1st release: Sept 2013; Last release: Sept 2013)
MATLAB code for performing pattern recognition using a range of different sparse coding algorithms, including the PC/BC-DIM algorithm. This code performs the experiments described in: M. W. Spratling (2014) Classification using sparse representations: a biologically plausible approach. Biological Cybernetics, 108(1):61-73.
drivers_modulators.zip (1st release: July 2013; Last release: July 2013)
MATLAB code for simulating both modulatory and driving influences of feedforward, lateral, and top-down connections with the PC/BC-DIM model. This code performs the experiments described in: M. W. Spratling (2014) A single functional model of drivers and modulators in cortex. Journal of Computational Neuroscience, 36(1): 97-118.
edge_detection.zip (1st release: Oct 2012; Last release: Oct 2012)
MATLAB code for performing image segmentation using the PC/BC-DIM model of V1 with lateral connections. This code performs the experiments described in: M. W. Spratling (2013) Image segmentation using a sparse coding model of cortical area V1. IEEE Transactions on Image Processing, 22(4):1631-43.
partial_transforms.zip (1st release: May 2012; Last release: May 2012)
MATLAB code for modelling partial reference frame transformations using the PC/BC-DIM model. This code performs the experiments described in: K. De Meyer and M. W. Spratling (2013) A model of partial reference frame transforms through pooling of gain-modulated responses. Cerebral Cortex, 23(5):1230-9.
v1_reverse_correl.zip (1st release: January 2012; Last release: January 2012)
MATLAB code for modelling reverse correlation experiments using the PC/BC-DIM model of V1. This code performs the experiments described in: M. W. Spratling (2012) Predictive coding accounts for V1 response properties recorded using reverse correlation. Biological Cybernetics, 106(1):37-49.
v1_saliency.zip (1st release: July 2011; Last release: July 2011)
MATLAB code for modelling visual saliency using the PC/BC-DIM model. This code performs the experiments described in: M. W. Spratling (2012) Predictive coding as a model of the V1 saliency map hypothesis. Neural Networks, 26:7-28.
dim_learn_recip_weights.zip (1st release: June 2011; Last release: June 2011)
MATLAB code for learning in a hierarchical PC/BC-DIM model. The model is applied to learning the bars problem, and to learning using natural images. In the latter case RFs similar to those found in cortical areas V1 and V2 are learnt. This code performs the experiments described in: M. W. Spratling (2012) Unsupervised learning of generative and discriminative weights encoding elementary image components in a predictive coding model of cortical function. Neural Computation, 24(1): 60-103.
gain_modulation.zip (1st release: March 2011; Last release: March 2011)
MATLAB code for learning (using the DIM algorithm) RFs in which one input is driving and the other modulatory, giving rise to the types of "gain field" observed in various cortical areas (for example when a retinal RF is modulated by eye position). This code performs the experiments described in: K. De Meyer and M. W. Spratling (2011) Multiplicative gain modulation arises through unsupervised learning in a predictive coding model of cortical function. Neural Computation, 23(6):1536-67.
v1_suppression_mechanisms.zip (1st release: March 2011; Last release: March 2011)
MATLAB code for modelling V1 suppression mechanisms using the PC/BC-DIM model. This code performs the experiments described in: M. W. Spratling (2011) A single functional model accounts for the distinct properties of suppression in cortical area V1. Vision Research, 51:563-76.
v1_response_properties.zip (1st release: February 2010; Last release: March 2010)
MATLAB code for modelling V1 simple cell RF properties using the PC/BC-DIM model. This code performs the experiments described in: M. W. Spratling (2010) Predictive coding as a model of response properties in cortical area V1. Journal of Neuroscience, 30(9):3531-43.
pc_attention.zip (1st release: February 2010; Last release: February 2010)
MATLAB code for modelling visual attention and binding using the PC/BC-DIM model. This code performs the experiments described in: M. W. Spratling (2008) Predictive coding as a model of biased competition in visual attention. Vision Research, 48(12):1391-408.
dim_squares.m (1st release: February 2010; Last release: February 2010)
MATLAB code for learning the squares problem using the divisive input modulation (DIM) algorithm. This code performs one of the tasks described in: M. W. Spratling, K. De Meyer and R. Kompass (2009) Unsupervised learning of overlapping image components using divisive input modulation. Computational Intelligence and Neuroscience, 2009(381457):1-19.