Welcome to an insightful journey into the world of multi-agent collaboration with the exciting project, “Too Many Cooks.” This blog will guide you through the installation and usage of the code for “Too many cooks: Bayesian inference for coordinating multi-agent collaboration,” hailed for its contributions to cognitive science and multi-agent reinforcement learning. We’ll cover everything you need to know to set up the environment and run experiments seamlessly.
Introduction
Imagine a bustling kitchen where multiple cooks are trying to prepare different dishes at the same time. Each cook must not only complete their task but also coordinate with others to avoid chaos, maximize efficiency, and ensure every dish is perfect. This is exactly what our project achieves through a powerful mechanism known as Bayesian Delegation.
In this environment, agents must infer the hidden intentions of their peers, plan their actions, and collaborate as a coherent team. The result? A simulation that emulates the complexities of human collaboration in a fun, interactive manner!
Installation
Installing the necessary components for running the code is straightforward. Simply execute the following commands:
- Clone the GitHub repository:
git clone https://github.com/rosewang2008/gym-cooking.git
cd gym-cooking
pip3 install -e .
All experiments require Python 3, so make sure you have it installed on your system!
Usage
Now, let’s dive into how to run experiments using this project!
Running an Experiment
To execute a basic experiment, use the following command structure:
python main.py --num-agents number --level level_name --model1 model_name --model2 model_name --model3 model_name --model4 model_name
Here’s a breakdown of the arguments:
- number: Number of agents (up to 4).
- level_name: The name of the level (without the .txt extension).
- model_name: Includes options like
bdfor Bayesian Delegation,upfor Uniform Priors,dcfor Divide and Conquer, and others.
For instance, to run the salad recipe with 2 agents using Bayesian Delegation:
python main.py --num-agents 2 --level partial-divider_salad --model1 bd --model2 bd
Additional Commands
You can enhance your command with additional flags:
--recordwill save the observation at each time step as an image for review.
Manual Control
For a hands-on experience, you can manually control agents:
python main.py --num-agents 2 --level open-divider_salad --play
This allows you to explore the environment using the keyboard, where each agent can be controlled with the arrow keys!
Reproducing Paper Results
To run the full suite of experiments as detailed in the paper, use the provided script:
bash run_experiments.sh
You can modify the script for different agent numbers as needed.
Creating Visualizations
To generate results graphs from the experiments, navigate to the gym_cooking/misc/metrics directory and run:
python make_graphs.py --legend --time-step
And for completion graphs:
python make_graphs.py --legend --completion
Troubleshooting
If you encounter issues while installing or running the code, here are some common troubleshooting tips:
- Ensure you have Python 3 correctly installed on your system.
- Check for any dependency errors during installation. Make sure all required packages are installed.
- If encountering run-time errors, double-check your command syntax and that you’re in the correct directory.
For more insights, updates, or to collaborate on AI development projects, stay connected with fxis.ai.
Conclusion
By mastering these instructions, you’ll be able to explore the rich landscape of coordinated multi-agent learning within artificial intelligence. This project is not only a testament to the potential of AI in complex task completion but also showcases the intersection of cognitive science and machine learning.
At fxis.ai, we believe that such advancements are crucial for the future of AI, as they enable more comprehensive and effective solutions. Our team is continually exploring new methodologies to push the envelope in artificial intelligence, ensuring that our clients benefit from the latest technological innovations.
