labml


Namelabml JSON
Version 0.5.1 PyPI version JSON
download
home_pagehttps://github.com/labmlai/labml
SummaryOrganize Machine Learning Experiments
upload_time2024-03-21 07:36:43
maintainerNone
docs_urlNone
authorVaruna Jayasiri, Nipun Wijerathne
requires_pythonNone
licenseNone
keywords machine learning
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <div align="center" style="margin-bottom: 100px;">

<h1>Monitor deep learning model training and hardware usage from mobile.</h1>

[![PyPI - Python Version](https://badge.fury.io/py/labml.svg)](https://badge.fury.io/py/labml)
[![PyPI Status](https://pepy.tech/badge/labml)](https://pepy.tech/project/labml)
[![Docs](https://img.shields.io/badge/labml-docs-blue)](https://docs.labml.ai/)
[![Twitter](https://img.shields.io/twitter/follow/labmlai?style=social)](https://twitter.com/labmlai?ref_src=twsrc%5Etfw)

<img src="https://github.com/labmlai/labml/blob/master/images/cover-dark.png" alt=""/>
</div>

### 🔥 Features

* Monitor running experiments from mobile phone or laptop
* Monitor hardware usage on any computer
  with a single command
* Integrate with just 2 lines of code (see examples below)
* Keeps track of experiments including infomation like git commit, configurations and hyper-parameters
* API for custom visualizations
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/labmlai/labml/blob/master/samples/stocks/analysis.ipynb)
  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/vpj/poker/blob/master/kuhn_cfr/kuhn_cfr.ipynb)
* Pretty logs of training progress
* Open source!

### Hosting the experiments server

#### Prerequisites

To install `MongoDB`, refer to the official
   documentation [here](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/).

#### Installation

Install the package using pip:

```bash
pip install labml-app
```

#### Starting the server

```sh
# Start the server on the default port (5005)
labml app-server

# To start the server on a different port, use the following command
labml app-server --port PORT
```

***Optional: to setup and configure Nginx in your server, please refer
to [this](https://github.com/labmlai/labml/blob/master/guides/server-setup.md).***

You can access the user interface either by visiting `http://localhost:{port}` or, if configured on a separate machine,
by navigating to `http://{server-ip}:{port}`.

### Monitor Experiments

#### Installation

1. Install the package using pip.

```bash
pip install labml labml-app
```

2. Create a file named `.labml.yaml` at the top level of your project folder, and add the following line to the file:

```yaml
app_url: http://localhost:{port}/api/v1/default

# If you are setting up the project on a different machine, include the following line instead,
app_url: http://{server-ip}:{port}/api/v1/default
```

#### PyTorch example

```python
from labml import tracker, experiment

with experiment.record(name='sample', exp_conf=conf):
    for i in range(50):
        loss, accuracy = train()
        tracker.save(i, {'loss': loss, 'accuracy': accuracy})
```

#### Distributed training example

```python
from labml import tracker, experiment

uuid = experiment.generate_uuid() # make sure to sync this in every machine
experiment.create(uuid=uuid,
                  name='distributed training sample',
                  distributed_rank=0,
                  distributed_world_size=8,
                  )
with experiment.start():
    for i in range(50):
        loss, accuracy = train()
        tracker.save(i, {'loss': loss, 'accuracy': accuracy})
```

### 📚 Documentation

* [Python API Reference](https://docs.labml.ai)
* [Samples](https://github.com/labmlai/labml/tree/master/samples)

##### Guides

* [API to create experiments](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/experiment.ipynb)
* [Track training metrics](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/tracker.ipynb)
* [Monitored training loop and other iterators](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/monitor.ipynb)
* [API for custom visualizations](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/analytics.ipynb)
* [Configurations management API](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/configs.ipynb)
* [Logger for stylized logging](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/logger.ipynb)

### 🖥 Screenshots

#### Formatted training loop output

<div align="center">
    <img src="https://raw.githubusercontent.com/vpj/lab/master/images/logger_sample.png" alt="Sample Logs"/>
</div>

#### Custom visualizations based on Tensorboard logs

<div align="center">
    <img src="https://raw.githubusercontent.com/vpj/lab/master/images/analytics.png" alt="Analytics"/>
</div>

[//]: # (## Tools)

[//]: # ()
[//]: # (### [Training models on cloud]&#40;https://github.com/labmlai/labml/tree/master/remote&#41;)

[//]: # ()
[//]: # (```bash)

[//]: # (# Install the package)

[//]: # (pip install labml_remote)

[//]: # ()
[//]: # (# Initialize the project)

[//]: # (labml_remote init)

[//]: # ()
[//]: # (# Add cloud server&#40;s&#41; to .remote/configs.yaml)

[//]: # ()
[//]: # (# Prepare the remote server&#40;s&#41;)

[//]: # (labml_remote prepare)

[//]: # ()
[//]: # (# Start a PyTorch distributed training job)

[//]: # (labml_remote helper-torch-launch --cmd 'train.py' --nproc-per-node 2 --env GLOO_SOCKET_IFNAME enp1s0)

[//]: # (```)

### [Monitoring hardware usage](https://github.com/labmlai/labml/blob/master/guides/hardware_monitoring.md)

```sh
# Install packages and dependencies
pip install labml psutil py3nvml

# Start monitoring
labml monitor
```

[//]: # (## Other Guides)

[//]: # ()
[//]: # (#### [Setting up a local Ubuntu workstation for deep learning]&#40;https://github.com/labmlai/labml/blob/master/guides/local-ubuntu.md&#41;)

[//]: # ()
[//]: # (#### [Setting up a cloud computer for deep learning]&#40;https://github.com/labmlai/labml/blob/master/guides/remote-python.md&#41;)

## Citing

If you use LabML for academic research, please cite the library using the following BibTeX entry.

```bibtext
@misc{labml,
 author = {Varuna Jayasiri, Nipun Wijerathne},
 title = {labml.ai: A library to organize machine learning experiments},
 year = {2020},
 url = {https://labml.ai/},
}
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/labmlai/labml",
    "name": "labml",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "machine learning",
    "author": "Varuna Jayasiri, Nipun Wijerathne",
    "author_email": "vpjayasiri@gmail.com, hnipun@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/03/d4/8bc6ac433d0273ed961701c3c9f826620721ae7d2bcbc5affe78bbec31fa/labml-0.5.1.tar.gz",
    "platform": null,
    "description": "<div align=\"center\" style=\"margin-bottom: 100px;\">\n\n<h1>Monitor deep learning model training and hardware usage from mobile.</h1>\n\n[![PyPI - Python Version](https://badge.fury.io/py/labml.svg)](https://badge.fury.io/py/labml)\n[![PyPI Status](https://pepy.tech/badge/labml)](https://pepy.tech/project/labml)\n[![Docs](https://img.shields.io/badge/labml-docs-blue)](https://docs.labml.ai/)\n[![Twitter](https://img.shields.io/twitter/follow/labmlai?style=social)](https://twitter.com/labmlai?ref_src=twsrc%5Etfw)\n\n<img src=\"https://github.com/labmlai/labml/blob/master/images/cover-dark.png\" alt=\"\"/>\n</div>\n\n### \ud83d\udd25 Features\n\n* Monitor running experiments from mobile phone or laptop\n* Monitor hardware usage on any computer\n  with a single command\n* Integrate with just 2 lines of code (see examples below)\n* Keeps track of experiments including infomation like git commit, configurations and hyper-parameters\n* API for custom visualizations\n  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/labmlai/labml/blob/master/samples/stocks/analysis.ipynb)\n  [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/vpj/poker/blob/master/kuhn_cfr/kuhn_cfr.ipynb)\n* Pretty logs of training progress\n* Open source!\n\n### Hosting the experiments server\n\n#### Prerequisites\n\nTo install `MongoDB`, refer to the official\n   documentation [here](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-ubuntu/).\n\n#### Installation\n\nInstall the package using pip:\n\n```bash\npip install labml-app\n```\n\n#### Starting the server\n\n```sh\n# Start the server on the default port (5005)\nlabml app-server\n\n# To start the server on a different port, use the following command\nlabml app-server --port PORT\n```\n\n***Optional: to setup and configure Nginx in your server, please refer\nto [this](https://github.com/labmlai/labml/blob/master/guides/server-setup.md).***\n\nYou can access the user interface either by visiting `http://localhost:{port}` or, if configured on a separate machine,\nby navigating to `http://{server-ip}:{port}`.\n\n### Monitor Experiments\n\n#### Installation\n\n1. Install the package using pip.\n\n```bash\npip install labml labml-app\n```\n\n2. Create a file named `.labml.yaml` at the top level of your project folder, and add the following line to the file:\n\n```yaml\napp_url: http://localhost:{port}/api/v1/default\n\n# If you are setting up the project on a different machine, include the following line instead,\napp_url: http://{server-ip}:{port}/api/v1/default\n```\n\n#### PyTorch example\n\n```python\nfrom labml import tracker, experiment\n\nwith experiment.record(name='sample', exp_conf=conf):\n    for i in range(50):\n        loss, accuracy = train()\n        tracker.save(i, {'loss': loss, 'accuracy': accuracy})\n```\n\n#### Distributed training example\n\n```python\nfrom labml import tracker, experiment\n\nuuid = experiment.generate_uuid() # make sure to sync this in every machine\nexperiment.create(uuid=uuid,\n                  name='distributed training sample',\n                  distributed_rank=0,\n                  distributed_world_size=8,\n                  )\nwith experiment.start():\n    for i in range(50):\n        loss, accuracy = train()\n        tracker.save(i, {'loss': loss, 'accuracy': accuracy})\n```\n\n### \ud83d\udcda Documentation\n\n* [Python API Reference](https://docs.labml.ai)\n* [Samples](https://github.com/labmlai/labml/tree/master/samples)\n\n##### Guides\n\n* [API to create experiments](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/experiment.ipynb)\n* [Track training metrics](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/tracker.ipynb)\n* [Monitored training loop and other iterators](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/monitor.ipynb)\n* [API for custom visualizations](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/analytics.ipynb)\n* [Configurations management API](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/configs.ipynb)\n* [Logger for stylized logging](https://colab.research.google.com/github/labmlai/labml/blob/master/guides/logger.ipynb)\n\n### \ud83d\udda5 Screenshots\n\n#### Formatted training loop output\n\n<div align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/vpj/lab/master/images/logger_sample.png\" alt=\"Sample Logs\"/>\n</div>\n\n#### Custom visualizations based on Tensorboard logs\n\n<div align=\"center\">\n    <img src=\"https://raw.githubusercontent.com/vpj/lab/master/images/analytics.png\" alt=\"Analytics\"/>\n</div>\n\n[//]: # (## Tools)\n\n[//]: # ()\n[//]: # (### [Training models on cloud]&#40;https://github.com/labmlai/labml/tree/master/remote&#41;)\n\n[//]: # ()\n[//]: # (```bash)\n\n[//]: # (# Install the package)\n\n[//]: # (pip install labml_remote)\n\n[//]: # ()\n[//]: # (# Initialize the project)\n\n[//]: # (labml_remote init)\n\n[//]: # ()\n[//]: # (# Add cloud server&#40;s&#41; to .remote/configs.yaml)\n\n[//]: # ()\n[//]: # (# Prepare the remote server&#40;s&#41;)\n\n[//]: # (labml_remote prepare)\n\n[//]: # ()\n[//]: # (# Start a PyTorch distributed training job)\n\n[//]: # (labml_remote helper-torch-launch --cmd 'train.py' --nproc-per-node 2 --env GLOO_SOCKET_IFNAME enp1s0)\n\n[//]: # (```)\n\n### [Monitoring hardware usage](https://github.com/labmlai/labml/blob/master/guides/hardware_monitoring.md)\n\n```sh\n# Install packages and dependencies\npip install labml psutil py3nvml\n\n# Start monitoring\nlabml monitor\n```\n\n[//]: # (## Other Guides)\n\n[//]: # ()\n[//]: # (#### [Setting up a local Ubuntu workstation for deep learning]&#40;https://github.com/labmlai/labml/blob/master/guides/local-ubuntu.md&#41;)\n\n[//]: # ()\n[//]: # (#### [Setting up a cloud computer for deep learning]&#40;https://github.com/labmlai/labml/blob/master/guides/remote-python.md&#41;)\n\n## Citing\n\nIf you use LabML for academic research, please cite the library using the following BibTeX entry.\n\n```bibtext\n@misc{labml,\n author = {Varuna Jayasiri, Nipun Wijerathne},\n title = {labml.ai: A library to organize machine learning experiments},\n year = {2020},\n url = {https://labml.ai/},\n}\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Organize Machine Learning Experiments",
    "version": "0.5.1",
    "project_urls": {
        "Documentation": "https://docs.labml.ai/",
        "Homepage": "https://github.com/labmlai/labml"
    },
    "split_keywords": [
        "machine",
        "learning"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4896286652791e4729a2d29397c5b320d14978e246089b67797c613aef7d738a",
                "md5": "b1c75a466c45e7f5ac3e30f27774b403",
                "sha256": "b4e9bb62291abba492e0f82dfecead13e7688a5c36a99264ed70c425641c8485"
            },
            "downloads": -1,
            "filename": "labml-0.5.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "b1c75a466c45e7f5ac3e30f27774b403",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 110832,
            "upload_time": "2024-03-21T07:36:40",
            "upload_time_iso_8601": "2024-03-21T07:36:40.174125Z",
            "url": "https://files.pythonhosted.org/packages/48/96/286652791e4729a2d29397c5b320d14978e246089b67797c613aef7d738a/labml-0.5.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "03d48bc6ac433d0273ed961701c3c9f826620721ae7d2bcbc5affe78bbec31fa",
                "md5": "4003d95e4d3f95e9935b8afb1478d1ea",
                "sha256": "04186a63664b583d5f1010a0d9ac722c9198e132525e0a4c40e052adde524056"
            },
            "downloads": -1,
            "filename": "labml-0.5.1.tar.gz",
            "has_sig": false,
            "md5_digest": "4003d95e4d3f95e9935b8afb1478d1ea",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 82753,
            "upload_time": "2024-03-21T07:36:43",
            "upload_time_iso_8601": "2024-03-21T07:36:43.994037Z",
            "url": "https://files.pythonhosted.org/packages/03/d4/8bc6ac433d0273ed961701c3c9f826620721ae7d2bcbc5affe78bbec31fa/labml-0.5.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-21 07:36:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "labmlai",
    "github_project": "labml",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "labml"
}
        
Elapsed time: 0.23738s