Skip to content

labmlai/labml

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
June 10, 2022 22:16
September 15, 2022 15:37
September 10, 2023 09:49
November 13, 2022 12:31
July 6, 2022 09:35
August 15, 2022 08:43
July 23, 2021 13:12
August 6, 2021 15:20
September 3, 2023 20:47
June 30, 2022 19:54
July 23, 2021 11:53
June 24, 2019 15:13
August 15, 2022 09:53

πŸ”₯ Features

  • Monitor running experiments from mobile phone (or laptop) View Run
  • 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
  • Keep Tensorboard logs organized
  • Save and load checkpoints
  • API for custom visualizations Open In Colab Open In Colab
  • Pretty logs of training progress
  • Change hyper-parameters while the model is training
  • Open source! we also have a small hosted server for the mobile web app

Installation

You can install this package using PIP.

pip install labml

PyTorch example

Open In Colab Kaggle

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})

PyTorch Lightning example

Open In Colab Kaggle

from labml import experiment
from labml.utils.lightening import LabMLLighteningLogger

trainer = pl.Trainer(gpus=1, max_epochs=5, progress_bar_refresh_rate=20, logger=LabMLLighteningLogger())

with experiment.record(name='sample', exp_conf=conf, disable_screen=True):
        trainer.fit(model, data_loader)

TensorFlow 2.X Keras example

Open In Colab Kaggle

from labml import experiment
from labml.utils.keras import LabMLKerasCallback

with experiment.record(name='sample', exp_conf=conf):
    for i in range(50):
        model.fit(x_train, y_train, epochs=conf['epochs'], validation_data=(x_test, y_test),
                  callbacks=[LabMLKerasCallback()], verbose=None)

πŸ“š Documentation

Guides

πŸ–₯ Screenshots

Formatted training loop output

Sample Logs

Custom visualizations based on Tensorboard logs

Analytics

Tools

Hosting your own experiments server

# Install the package
pip install labml-app -U

# Start the server

labml app-server

Training models on cloud

# Install the package
pip install labml_remote

# Initialize the project
labml_remote init

# Add cloud server(s) to .remote/configs.yaml

# Prepare the remote server(s)
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

# Install packages and dependencies
pip install labml psutil py3nvml

# Start monitoring
labml monitor

Setting up a local Ubuntu workstation for deep learning

Setting up a cloud computer for deep learning

Citing

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

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