lolaml-跟踪你的ml实验

lolaml的Python项目详细描述


LolaML-跟踪您的ml实验

Documentation StatusPipeline StatusCoverage ReportPyPI Version

用lolaml跟踪你的机器学习实验, 不要丢失任何信息或忘记哪个参数产生了哪个结果。 lola为运行创建一个简单的json表示,其中包含 你记录的信息。 json可以很容易地与朋友和同事共享以进行协作。 洛拉努力做到非魔术和简单,但可配置。

功能:

  • 一个简单的日志记录界面
  • 日志数据的简单json表示形式
  • 适用于任何机器学习库
  • 为每次运行自动创建项目文件夹
  • 自动将工件上载到远程存储桶(如果需要的话)
  • 简单的Jupyter笔记本仪表板(更多…)
import lolaml as lola

# Use the run context manager to start/end a run
with lola.Run(project="mnist", prefix_path="data/experiments") as run:
    # a unique id for the run
    print(run.run_id)
    # store all artifacts (model files, images, etc.) here
    print(run.path)  # -> data/experiments/mnist/<run_id>

    run.log_param("lr", 0.1)
    run.log_param("epochs", 10)

    run.log_tags("WIP", "RNN")

    # Create and train your model...

    run.log_metric("loss", loss, step=1)
    run.log_metric("train_acc", train_acc, step=1)
    run.log_metric("val_acc", val_acc, step=1)

    model.save(os.path.join(run.path, "model.pkl"))

# After a run there is a lola_run*.json file under run.path.
# It contails all the information you logged.

运行之后,有一个json文件如下所示:

{
    "project": "mnist",
    "run_id": "9a531da0-dc43-4dcc-8968-77fd480ff7ee",
    "status": "done",
    "path": "data/experiments/mnist/9a531da0-dc43-4dcc-8968-77fd480ff7ee",
    "run_file": "data/experiments/mnist/9a531da0-dc43-4dcc-8968-77fd480ff7ee/lola_run.json",
    "user": "stefan",
    "start_time": "2019-02-16 12:49:32.782958",
    "end_time": "2019-02-16 12:49:32.814529",
    "metrics": [
        {
            "name": "loss",
            "value": 1.5
            "step": 1,
            "ts": "2019-02-16 12:49:32.813750"
        },
        ...
    ],
    "params": {
        "lr": "0.1",
        "epochs": 10,
    },
    "tags": ["WIP", "RNN"],
    "artifacts": {
        "data/experiments/mnist/9a531da0-dc43-4dcc-8968-77fd480ff7ee/lola_run_9a531da0-dc43-4dcc-8968-77fd480ff7ee.json": {},
        ...
    },
    "git": {
        "sha": "41cb4fb11b7e937c602c2282b9275200c88b8797",
        "status": "...",
        "diff": "...",
    },
    "call_info": {
        "cwd": "some/where",
        "__file__": "somefile.py",
        "argv": [],
    }
}

lola可以自动将所有工件上载到远程存储桶中:

with lola.run(
    remote_location="gs://somewhere",
    remote_credentials="service_account.json",
) as run:
    # train and log ...

# All artifacts are uploaded now

远程位置也可以用.lola.toml文件配置。

此外,lola还提供一些助手来分析您的实验:

TOdo添加仪表板图像

设置

要求

  • Python3.6+

安装

将此库直接安装到激活的虚拟环境中:

$ pip install lolaml

或者将其添加到您的Poetry项目:

$ poetry add lolaml

其他

此项目是用cookiecutter生成的 使用jacebrowning/template-python。 谢谢!

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java爬虫获取外部网站搜索结果   java Bluestack未连接到eclipse   java如何从ConstraintViolationException Hibernamte获取数据库字段名   HttpResponse HttpResponse=httpClient引发java运行时错误。执行(httpPost);   Jama中矩阵的java点积和叉积   java有什么方法可以唯一地识别可扩展设备吗?   java我需要用*来写我的名字,但我不断遇到一个错误,我对编码很陌生   java变量是在内部类中访问的。需要被宣布为最终决定。但我不想宣布最终结果   java如何缩短base64图像字符串,Android?   JavaSpringMVC:计划方法不自动触发   图形学习Java 2D API的好资源是什么?   如何在java中对方法进行排队   java JavaFX多行   java Selenium无法在[链接]上找到基于CSS元素的密码字段元素http://www.cartasi.it/gtwpages/index.jsp   Java中的equals()和hashCode()契约   软删除情况下的java Hibernate二级缓存   java为什么这段代码要两次调用这些方法?