Appendix B Launch and arrangement of the workshop
Preparation
Unpack qualia_mira_practice.zip into a separate directory. Inside there are programs, instructions and saved results. Start with the README.md file. Don't run Python files directly from the archive viewer: they need adjacent files. For work 2–8 agent_lab.py and mechanisms_lab.py must be nearby. It is convenient to save new results under different names so that the original examples remain available for comparison.
Open a terminal in this directory. On Windows, this can be done through the Explorer menu or by using the cd command. On macOS and Linux, use a regular terminal. Check your Python version: 3.10 or later is required. If Python is not already installed, use the official python.org distribution for your system. The name of the command depends on the installation.
python3 --version
python3 agent_lab.py --self-test
python3 mechanisms_lab.py --self-test
On Windows, the typical form of the first command is py -3 --version. Similarly, replace python3 in the remaining commands. If the system reports that the command was not found, this is an error in starting the interpreter, and not the result of the experiment. If agent_lab.py is not found, check the current directory. If mechanisms_lab.py cannot import agent_lab, check that both files are unpacked together.
For the first acquaintance, you can complete all eight works and pair analysis with a single command. It creates a separate results_... directory with the results and the run_manifest.json file, which contains the parameters and checksums of the programs.
python3 run_practice.py
One job can be selected with the --lab parameter, for example python3 run_practice.py --lab 6. On Windows, use py -3 instead of python3. General run of tests without saving a new experiment: python3 run_practice.py --self-test.
How to read result files
JSON stores data in the form of named fields and lists. You don't need to master the entire format at once. In lab01_results.json, the summary section contains the general results of the modes, and per_run contains the results of individual scenarios. In mechanisms_results.json, the works are located inside labs under numbers from 2 to 8. Detailed explanations of the fields are included in the archive instructions and chapters 28–30.
The success_rate and utility_per_step fields indicate the success rate and utility per step. The value 0.8 for the success rate corresponds to eighty percent. The queries field contains the number of additional queries, and brier_score is an indicator of the quality of the probabilistic forecast. When comparing tables, always check that the number of steps, parameters, and averaging method are the same.
First reproduce the original result. Then create a new file with one parameter changed. Keep the command text and the preliminary expectation nearby. After checking on the original seed, use another one. Random grain ensures repeatability of a particular scenario; it does not make a single scenario a sufficient study.
Eight works
Work | Program | Main material |
1 | agent_lab.py | Memory of the world, model of action, value of observation |
2 | mechanisms_lab.py --lab 2 | Geometry of representations and invariants |
3 | mechanisms_lab.py --lab 3 | Reprocessing and detailed control |
4 | mechanisms_lab.py --lab 4 | Limited selection and general access |
5 | mechanisms_lab.py --lab 5 | M0, M1, M2, common tracker and source delay |
6 | mechanisms_lab.py --lab 6 | Designed internal access and interventions |
7 | mechanisms_lab.py --lab 7 | Choosing a strategy based on past mistakes |
8 | mechanisms_lab.py --lab 8 | Composite candidate and component contribution control |
All operations 2–8 can be performed in one run without the --lab parameter. The command below will create a new result file. It does not send anything to an external service and does not change the code.
python3 mechanisms_lab.py --json my_mechanisms.json
The programs are designed to study small mechanisms. Their detailed structure is described in the book. Combining function names into one system does not replace separate testing of how the components interact. The eighth paper specifically includes comparisons in which the added mechanism does not provide an advantage in the base condition.
Additional step-by-step models
The teaching_lab.py file complements the original eight papers. It uses the standard Python library and when analyzing chapter 31 reads the nearby bio_features.csv. Execute the commands from the practice folder of the unpacked kit. The python command indicates the available Python interpreter 3; on some systems it runs as python3 or py -3. Basic tests and training models do not require the installation of external packages.
python teaching_lab.py --self-test
python teaching_lab.py --chapter 13
python teaching_lab.py --chapter 25
python teaching_lab.py --chapter 31
python teaching_lab.py --chapter 33
python teaching_lab.py --chapter 34
Each run saves JSON with rules or numeric results. For chapter 31, a ready-made table allows you to repeat the main analysis without loading a large array. The extract_bio_features.py script takes the official file [47], checks its checksum and repeats the feature extraction with obvious exceptions. This particular step requires NumPy; details and attribution are in the workshop README.