This repository contains the official code and simulation models for the research paper "Infants and Mobiles: Developing an Understanding of Cause and Effect" accepted at Developmental Science.
To run this simulation, you will need the following installed on your system:
- Python 3.8 or higher
- Git (for cloning the repository)
We recommend using a virtual environment to manage dependencies and avoid conflicts. Follow these steps to set up your local environment:
1. Clone the repository
2. Create a virtual environment:
# On macOS/Linux
python3 -m venv cais
# On Windows
python -m venv cais
3. Activate the virtual environment:
# On macOS/Linux
source cais/bin/activate
# On Windows
cais\Scripts\activate
4. Install the required dependencies:
pip install -r requirements.txt
The main algorithm is contained within simulation.py. Once your environment is set up and activated, you can execute the simulation using the command line.
Basic Run:
python simulation.py
You can customize the simulation behavior by passing various command-line arguments. The script supports different modeling approaches, environmental modes, and tuning parameters.
- Methods (
--method): Choose the core learning method."cais""controllability"
- Modes (
--mode): Define the environmental interaction mode."normal""inverted""bimodal"
- Hyper-parameters to explore:
--lr: Learning rate--n_taus: Number of quantiles--surprise_weight: Weight of the surprise term--smoothing: Exponential average smoothing factor
Note: Refer to the paper for explanations of these hyper-parameters.
If you use this code or our findings in your research, please cite our paper: