跳转到主要内容

未提供项目描述

项目描述

AEPsych Python客户端v0.2.0

这允许您使用Python与AEPsych服务器接口,进行基于模型的适应性实验。

安装

我们建议在虚拟环境(如Anaconda)下安装客户端。创建用于 AEPsychClient 的虚拟环境并激活后,可以通过pip进行安装

pip install aepsych_client

如果您是开发者,还应安装主AEPsych包,以便您可以运行测试。

配置

此接口使用基于ini的AEPsych配置,作为字符串传递给服务器

# 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;我们使用 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)

恢复功能

我们可以运行多个交错实验。当我们调用 configure 时,我们得到一个策略ID。客户端会跟踪所有这些策略ID,我们可以使用它们来恢复实验。通过这种方式,我们可以交错不同的模型运行。

# 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)

结束会话

完成实验后,您应该调用 client.finalize(),这将停止服务器并将您的数据保存到数据库中。

项目详情


下载文件

下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

aepsych_client-0.3.0.tar.gz (5.4 kB 查看散列)

上传时间:

构建分布

aepsych_client-0.3.0-py3-none-any.whl (6.5 kB 查看哈希值)

上传时间 Python 3

支持者