GithubHelp home page GithubHelp logo

xavierrobertsgaal / cogsci-23-computational-culture Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 23.22 MB

Code and data to reproduce "Computational principles underlying the evolution of cultural learning mechanisms"

License: MIT License

R 8.19% Jupyter Notebook 21.96% PostScript 46.96% Python 22.90%

cogsci-23-computational-culture's Introduction

Computational principles underlying the evolution of cultural learning mechanisms

Code and data to reproduce simulation results from the paper, "Computational principles underlying the evolution of cultural learning mechanisms", presented at CogSci 2023.

Figures and data:

  • Figures (.eps and .png versions) can be found in plots/.
  • Underlying data from the figures can be found in data/.
  • Simulation results from the paper (generated using default settings) can be downloaded from this link.

Key files for reproducing simulation and analyses:

  • create_charts.R generates the figures used in the paper. It requires that analyzed simulation data is present in data/, and it outputs figures to plots/.
  • data_cleaning.ipynb contains functionality to clean and analyze simulation results. It requires simulation results in sims/ or sims_gn/ and it saves prepared simulation data to data/.
  • run_simulation_gn.py launches the Model 1 simulation. It can be used from the command line. Documentation is below.
  • run_simulation.py generates the Model 2 simulation from the command line, as below.
  • theme_mprl_ggplot.R contains a ggplot theme for recreating figures.

Guide to simulation script

  1. Ensure you are using python >= 3.11.1 and that you have cloned the git repo into the appropriate folder. This may, but is not guaranteed to, work with earlier python versions.
  2. Install requirements using
pip install --upgrade pip
pip install -r requirements.txt
  1. Launch the simulation by typing python run_simulation.py or python run_simulation_gn.py (this takes a while!).

Note: The simulation scripts take the following arguments:

  • --path: The path to save simulation results (defaults to sims/ or sims_gn/ depending on the script)
  • --size: Initial population size (default 120)
  • --gens: Number of generations to simulate (default 5000)
  • --lo: Lower bound of parameter space (default 0.0)
  • --hi: Upper bound of parameter space (default 1.0)
  • --ns: Number of steps; how many values to interpolate between lo and hi (default 11)
  • --seed: Random number generator seed (default 42)
  • --ncores: Number of CPU cores to use (defaults to a single core, which is extremely slow. Suggest using a multiple of ns)
  • --params_path: Optional argument containing a .csv file with the parameters to run in columns named Delta, Lambda, and Kappa. If used, this overrides lo, hi, and ns. This will throw an error if the file is not a .csv formatted correctly.

Please create an issue here or email the corresponding author (Xavier Roberts-Gaal) if you have any questions.

cogsci-23-computational-culture's People

Contributors

xavierrobertsgaal avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.