No project description provided
Project description
AEPsych Python client
This lets you use Python to interface with the AEPsych server to do model-based adaptive experimentation.
Installation
We recommend installing the client under a virtual environment like
Anaconda.
Once you've created a virtual environment for AEPsychClient and activated it, you can install our
requirements and then install:
cd aepsych_client
pip install -r requirements.txt
pip install -e .
If you are a developer, you should also install the main AEPsych package so that you can run the tests.
Configuration
This interface uses AEPsych's ini-based config, which gets passed as a string to the server:
# Instantiate a client
client = AEPsychClient(ip="0.0.0.0", port=5555)
# Send a config message to the server, passing in a configuration filename
filename = 'configs/single_lse_2d.ini'
client.configure(config_path=filename)
Ask and tell
To get the next configuration from the server, we call ask; we report on the outcome with tell.
# Send an ask message to the server
trial_params = client.ask()
# Send a tell back
client.tell(config={"par1": [0], "par2": [1]}, outcome=1)
Resume functionality
We can run multiple interleaved experiments. When we call configure, we get back a strategy ID.
The client keeps track of all these strategy IDs and we can use them to resume experiments. By
doing this we can interleave different model runs.
# Configure the server using one config
client.configure(config_path=file1, config_name='config1')
# Run some stuff on this config
...
# Configure the server using another config
client.configure(config_path=file2, config_name='config2')
# Run some stuff on this other config
...
# Resume the past config
client.resume(config_name="config1)
Ending a session
When you are done with your experiment, you should call client.finalize(), which will stop the server and save your data to a database.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aepsych_client-0.1.tar.gz.
File metadata
- Download URL: aepsych_client-0.1.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70099946d4dc6ab954fe09abe5686fad77dd294c95792dd378223565f8068485
|
|
| MD5 |
7485e09529821cf055596fa78eb1a952
|
|
| BLAKE2b-256 |
802e10fd3309198d6c0cf0c94e59530400497527ffa844b43c2c33b366d06950
|
File details
Details for the file aepsych_client-0.1-py3-none-any.whl.
File metadata
- Download URL: aepsych_client-0.1-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c83d3ce2a1c729902e03194046aec1c632b2271910090932226d1d9462470320
|
|
| MD5 |
857a883b51e22e16a555a02fec25cc81
|
|
| BLAKE2b-256 |
0b38f4cef71802e61ce18527790cfec8bd22fb7032310e2f2cd67574d294ca27
|