未提供项目描述
项目描述
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 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | b3a23821eae4777eb845ccf64b49b909623b66750bc069a32b54718a92023270 |
|
MD5 | 14ad82a06725ac085a7fe5540303c1c5 |
|
BLAKE2b-256 | d70087393c507afb2c7e0e1f57aee69a1a4ab17d17b9c0be8efb8515fb0a9fee |
关闭
aepsych_client-0.3.0-py3-none-any.whl 的哈希值
算法 | 哈希摘要 | |
---|---|---|
SHA256 | 65dda00188b8f0c9dbb626ed148255ab587135675037b88e0e3a68532790dadc |
|
MD5 | 5fcd16cc23d9354a3e3daf21ec2846a1 |
|
BLAKE2b-256 | 183991d73f051abde612d3f47d1a3e72c05bdd270cf0879a484c86790df1c8f4 |