You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2.4 KiB

This code implements the simulation results reported in:

M. W. Spratling (2016) Predictive Coding as a Model of Cognition, Cognitive Processing, 17(3): 279-305.

Please cite this paper if this code is used in, or to motivate, any publications.


This code was tested with MATLAB Version (R2013b) and (R2015a)

To use this software:

    start matlab 
    move to the directory containing this code 
    run one of the functions listed in the table below

Each of the following functions runs an experiment reported in the above publication. The following table gives details of which MATLAB command produces each figure in this article.

Figure MATLAB Function
3a-c classify_images('YALE'); **
3d-f classify_images('USPS'); **
5a-c categorise_nosofsky_etal_expt1
5d-g categorise_nosofsky_etal_expt2
5h-j categorise_aha_goldstone
5k categorise_medin_schaffer_expt2
5l categorise_smith_minda_expt2
8left words(1); (Figs 1 to 5)
8right words(0); (Figs 1 to 5)
9 words(1); (Figs 6 to 9)
10a&b words_perceptual_advantage
10c words_perceptual_advantage_asynconset1
10d words_perceptual_advantage_asynconset2
10e words_perceptual_advantage_asynconset3
10f words_perceptual_advantage_asynconset4
10g words_perceptual_advantage_asynconset5
10h words_perceptual_advantage_asynconset7
10i words_perceptual_advantage_asynconset8
11 jets_sharks (Figs 7, 2, 4, 9, and 8)
12 task_switch_saccades
13 task_switch_mapping
14bottom collision_physics (Figs 1 to 3)
15bottom collision_physics (Figs 4 to 7)
16 collision_physics (Figs 8 to 11)

** to run these functions you will need the appropriate datasets installed on your system, and you will need to edit the paths in the file images_load_dataset.m to point to the locations where this data is stored.