Skip to content

oren-weiss/festa-et-al-2020

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neuronal variability reflects probabilistic inference tuned to natural image statistics

DOI

This code reproduces the figures from the paper:

Festa D, Aschner A, Davila D, Kohn A, Coen-Cagli R
Neuronal variability reflects probabilistic inference tuned to natural image statistics

BiorXiv preprint DOI:10.1101/2020.06.17.142182

Experimental Data DOI

Installation instructions

Software Requirements

The code is multi-platform, provided that the follwing two requirements are fulfilled:

Please note that cmd-stan must be compiled after being downloaded. Refer to the installation instructions on the website. Take note of the folder where you copy cmdstan, it needs to be associated to the variable dir_stan_home, as explained below.

Importing the data, setting the folders

  1. Import the data from Zenodo, using the following link:
    https://doi.org/10.5281/zenodo.4710066
    If you wish to use the default paths, simply create a folder called data data in the project directory (if it does not exist), and copy the contents of festa-et-al-2021-data.zip in it.
  2. Run set_dirs.jl with Julia, indicate the directory paths when prompted. The directory paths will be stored in the file data/local_dirs.json. You can also modify the file directly to indicate the data directories, as follows:
{
  "dir_exp":"<directory containing experimental data>",
  "dir_img":"<directory containing natural images>",
  "dir_stan_home":"<home directory of cmd-stan installation>"
}

Make sure the directories exists. Regarding dir_stan_home, remember that Stan must be compiled locally, as specified by the cmdstan installation instructions.

Internal dependencies

To load the code libraries and all package dependencies, run the script install_dependencies.jl from the home folder of the project.

Generating figures

The scripts that generate each figure are in the folder scripts/figures/. The name of each file refers to the corresponding figure in the paper.

The scripts automatically save the figures in the plots folder, which is created in the home directory of the project.

Note that training a GSM model for figures 1D, 2D,3A may require 15 to 30 minutes (the code is not optimized for speed). Therefore, by default, the trained model is saved on disk, and cached. If you change the GSM parameters and you require a new training you can either:

  • Remove the cached files, contained in src/tmp
  • Call the script with the --rebuildGSM option, for example:
    julia paperfigures/3A.jl --rebuildGSM .

Inspecting the code

To inspect the code and modify its parameters it is recommended using Juno, the official IDE for Julia.

Bugs and issues

In case of unexpected errors or problems, please submit an issue using the GitHub interface. Note that the code can only be tested and maintained on Linux platforms with the required versions of Julia and cmd-stan.

Code curated by Dylan Festa ORCID logo


Code for "Neuronal variability reflects probabilistic inference tuned to natural image statistics" by Festa, Aschner, Davila, Kohn and Coen-Cagli is licensed under CC BY-SA 4.0

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Julia 99.8%
  • Shell 0.2%