Skip to main content

Just Bench It: RL Algorithm Benchmarking Tool

这个项目提供了一个简单的工具,用于对强化学习(RL)算法在Atari游戏上进行基准测试。 WEBSITE: https://justbechit.github.io/rl_ladder/

安装

PYPI

  1. 安装:
    pip install just-bench-it
    

Build from source

  1. 克隆这个仓库:

    git clone https://github.com/your_username/just_bench_it.git
    cd just_bench_it
    
  2. 安装依赖:

    pip install -e .
    

使用方法

  1. 创建你的RL agent类,并使用@benchmark装饰器。

  2. 在你的agent类中实现以下方法:

    • set_env_info(self, env_info): 设置环境信息
    • act(self, state): 根据当前状态选择动作
    • update(self, state, action, reward, next_state, done): 更新agent的内部状态或模型
  3. 运行你的脚本来执行基准测试。

示例

这里有一个DQN agent的示例实现:

from just_bench_it import benchmark

@benchmark(pretrained=False, train_episodes=1000, eval_episodes=100)
class DQNAgent:
    def __init__(self):
        # 初始化你的DQN agent
        pass

    def set_env_info(self, env_info):
        # 设置环境信息: bench_it 会提供当前动作空间和观察空间
        #         input_shape = env_info['observation_space'].shape
        #         output_dim = env_info['action_space'].n
        #  不同的环境其输入可能不同,确保您的算法能够应对不同环境
        pass

    def act(self, state):
        # 根据状态选择动作
        pass

    def update(self, state, action, reward, next_state, done):
        # 更新agent
        pass

if __name__ == "__main__":
    agent = DQNAgent()
    results = agent.bench()
    print(results)

自定义

你可以通过修改@benchmark装饰器的参数来自定义基准测试:

  • pretrained: 是否使用预训练模型(默认为False)
  • train_episodes: 训练的回合数(默认为1000)
  • eval_episodes: 评估的回合数(默认为100)

结果

基准测试的结果会自动发布为GitHub issue,包含每个环境的平均得分和其他相关信息。

贡献

欢迎提交问题报告和拉取请求。对于重大更改,请先开issue讨论您想要更改的内容。

许可证

MIT

Metadata

Release files for just-bench-it 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for just-bench-it 0.1.9
File Size Uploaded Provenance Actions
just_bench_it-0.1.9.tar.gz 8.7 kB Without provenance Details for just_bench_it-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for just-bench-it 0.1.9
File Interpreter ABI Platform Actions
just_bench_it-0.1.9-py3-none-any.whl Python 3 none any Details for just_bench_it-0.1.9-py3-none-any.whl

Total release size: 17.7 kB

Release files / just_bench_it-0.1.9.tar.gz

Download URL just_bench_it-0.1.9.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
b1928f4839927c39276b92fb6a5445e967ef9656bfc299932260f4742d4d7c63
BLAKE2b-256 checksum
How to use checksums
aae18e591c6875814af77f46ad7323356ae200ad1865bb3bb8662275184c9d3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Release files / just_bench_it-0.1.9-py3-none-any.whl

Download URL just_bench_it-0.1.9-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1f5e365c4a611fd9dba9503c2cda3772eb401a0c381fdd3df3afa0a6e7383fe0
BLAKE2b-256 checksum
How to use checksums
89ea2cf6ff44d01a45ccdf4704bd7ac487c3aa4918c9e9d20785767348f603f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.9.6

Security for just-bench-it 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page