Skip to main content

Happy Experiments in Python (HEPY)

中文介绍

HE是一个针对命令行实验的管理工具。主要对实验中的三个部分进行管理:

  1. 实验代码版本管理。对每个实验(Experiment),HE会维护一个代码版本,用户可以随时切换到过去的代码版本进行实验。 对于需要频繁修改代码的实验而言,HE可以节省实验者大量的精力,同时提高了实验的可复现性。

  2. 实验(超)参数管理。每个实验只有一份代码,但是可能包含多个试验(Trial)。 每个试验的命令行参数不同,命令行参数决定了这次试验的实验参数。HE在每次试验的开始,会记录这次试验的超参数。

  3. 实验结果的管理。HE可以将实验结果自动保存到对应的实验文件夹下。也支持在实验结果中的评价指标进行正则匹配。

安装方式

pip install hepy

或者

pip install git+https://github.com/JunguangJiang/Happy-Experiments.git@master

使用教程

注意事项

由于代码版本管理时会复制代码目录下的文件,用户首先需要:

  1. 创建.heignore文件,这个文件的语法和.gitignore相似。在进行代码版本管理时,会忽略.heignore中匹配的文件。
  2. 确保所有相对路径的数据文件夹都是软连接。否则复制数据文件夹会消耗大量的资源。
正式的教程
  1. 进入代码目录下

  2. 初始化

    he init
    

    在代码目录下会出现文件夹he_workspace。

  3. 运行一个试验

    he run --exp ${experiment_name} -- ${script}
    

    ${experiment_name}是你给这个实验取的名字, ${script}是运行这个实验的脚本。 比如运行

    he run --exp test -- ls -l
    

    会得到下列输出

    Create new experiment: test
    
    Running script: ls -l
    total 44
    ....
    
    Finish experiment: test
    

    在he_workspace文件夹下出现了一个新的文件夹test。 test/code中包含了当前时刻的代码。test/0.txt包含了第一次试验的结果。

    • 如果不指定实验名称,默认会采用当前的时间作为实验名称。
    • 如果指定的实验名称与此前的重复,则会使用过去实验时刻的代码。
  4. 展示实验结果

he show ${experiment_names}

Metadata

Release files for hepy 0.0.2

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

Source distribution (sdist)

Source distribution for hepy 0.0.2
File Size Uploaded Provenance
hepy-0.0.2.tar.gz 7.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hepy 0.0.2
File Interpreter ABI Platform
hepy-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Release files / hepy-0.0.2.tar.gz

Download URL hepy-0.0.2.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
167d63867a83c50cb359b93cadbb66b341eee3984a6c202b1ade1af4ca9f6ffd
BLAKE2b-256 checksum
How to use checksums
069890596807451bc3a367aa7e870f978aaf2267c769c979b19dd972510024cd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

Release files / hepy-0.0.2-py3-none-any.whl

Download URL hepy-0.0.2-py3-none-any.whl
Size 9.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
709eb1af829e3a0a04d683a9deaa0dec6c1649d9cd7d67792259936b9c077cb9
BLAKE2b-256 checksum
How to use checksums
b028525b974cf541c241cf33cf56e26ad7f0ed0e15b058c16003d9565de1095a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.6.10

Security for hepy 0.0.2

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.

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files No provenance

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