Skip to main content

A python package which can help you visually track your training process of machine-learning

Project description

MLSwanlab 用户使用指南

为了帮助您更好地理解如何使用我们的MLSwanlab库进行模型训练过程中的损失和准确度实时跟踪,这里提供了详细的步骤。

1. 安装 MLSwanlab

首先,您需要安装MLSwanlab库。可以使用以下命令通过pip进行安装:

pip install MLSwanlab

2. 导入 Tracker 类

在您的训练代码中,首先需要做的是导入我们提供的Tracker类。您可以通过以下方式进行:

from MLSwanlab.tracker import Tracker

3. 定义训练函数

在开始训练之前,您需要定义一个训练函数。这是一个典型的训练函数例子:

def my_training_function(epoch):
    # 在这里插入您的训练代码
    # 根据您的模型和数据计算损失和精度
    # 假设我们在这里随机生成一些数据
    import random
    loss = random.uniform(0, 1)
    accuracy = random.uniform(0, 1)
    return loss, accuracy

注意: 您的训练函数必须接受一个名为epoch的参数,并返回两个值:lossaccuracy

4. 实例化和使用 Tracker 类

接下来,您可以实例化Tracker类,并将您的训练函数作为参数传给它。然后,只需调用track()方法即可启动训练:

tracker = Tracker(epochs=100, user_training_func=my_training_function)
tracker.track()

在训练开始后,MLSwanlab将会启动一个Flask服务器,实时更新并提供训练的损失和精度数据。

5. 查看实时训练指标

最后,您可以使用任意的web浏览器,访问 http://localhost:5000/metrics 来查看训练的实时指标。

注意: 如果您运行的主机有端口访问限制,您可能需要对您的网络配置进行相应的调整。

这就是所有您需要了解的训练和实时监控训练过程的步骤。如果您遇到任何问题,欢迎提交问题或联系我们。Swanlab团队祝您使用愉快!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MLSwanlab-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

MLSwanlab-0.0.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file MLSwanlab-0.0.1.tar.gz.

File metadata

  • Download URL: MLSwanlab-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for MLSwanlab-0.0.1.tar.gz
Algorithm Hash digest
SHA256 16d5785e8ca0436045a5c6ea2ecce2c87031ea0a95847f37a8ca68b0d99ca5a6
MD5 e1e11a3ad08f62a2f014ac01d8e97a1a
BLAKE2b-256 bfd8cde91ca7e86bc05da06517c78242771b2ad2c28eef487831692717dddc3b

See more details on using hashes here.

File details

Details for the file MLSwanlab-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: MLSwanlab-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for MLSwanlab-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 535ac9c4a64d8493d0fd39c4cf3f28d2c64a8781896fc6b2d4b89dd097750daa
MD5 4a7a9f71bbcdd0195b8f476e55c84e78
BLAKE2b-256 ec99823355e92fd565d905ccb3af52d38942f5e5585f9b244fa984e89865e8ed

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page