Code Monkey home page Code Monkey logo

swanlab's Introduction

SwanLab Library

Track and visualize all the pieces of your machine learning pipeline

/ license license / pypi Download Github Discussion

👋 Join our WeChat

English | 中文

Table of Contents


Changelog

[24/01/25] 😄 We supported a new Config/Summary table component that supports parameter search. Additionally, we've used new fonts and color schemes.

[24/01/23] 🚨 We use SQLite database and Peewee to replace the previous basic configuration information reading and writing solution by #114. It's a major change that is highly beneficial for the future of the project, but the drawback is that it's not compatible with old versions (swanlab<=v0.1.4) of log data files. Therefore, if you need to visualize log files generated by older versions, please use transfer script

Additionally, we supported export the experiment list as CSV, new environment record items Run path and logdir, added interactive quick copy function, and new API swanlab.config.

[24/01/14] 🔥 We supported a new UI, tracking additional environment information, including command, git commit/branch and memory. Additionally, we've added a logdir API, allowing developers to set the directory for log files.

Full Changelog


Key Function

  • 🧪 Experiments GridView: compare your key metrics for inspiration faster
  • 📊 Charts: visualize your entire training process
  • ⚡️ Track machine-learning pipeline: Hyperparameters, Config, Metric, Terminal logging, Environment Information auto save

  • 🥔 Offline Support: SwanLab can run entirely offile, ithout requiring any access to the Internet. For instance, this may be on your local machine, behind a corporate firewall, or in a datacenter

Note

See the SwanLab Documentaion and Examples for a full description of the SwanLab.


Installation

with pip

Requirement:Python 3.8+.

Use pip to install our stable release version. The installation command is as follows:

pip install -U swanlab

with source code

If you need the bleeding edge of the code and can't wait for a new release, you must install the library from source


Getting Started

  1. First, install the SwanLab SDK with pip:
pip install -U swanlab
  1. Second, Use the example code snippet below as a template to integrate SwanLab to your Python script:
import swanlab

# Start a SwanLab Run with swanlab.init
swanlab.init(
  # save model inputs and hyperparameters in a swanlab.config object
  config={'learning_rate': 0.01},
)

# Model training code here...

# Log metrics over time for visualizing performance with swanlab.log
for epoch in range(1, 20):
    swanlab.log({"loss": loss})
  1. Third, Run a Dashboard:
$ swanlab watch

That's it! Open http://127.0.0.1:5092 to view a dashboard of your first SwanLab Experiment.


Use Case

Learn how to use SwanLab more effectively by following these use cases:

Code Cases Description
Hello World Getting Started
MNIST Handwriting recognition based on a plain net and MNIST dataset with pytroch, swanlab.
Image Classification Cat and dog classification based on ResNet50 with pytorch, swanlab and gradio. Tutorial.
Text Generation Text generation based on Word_language_model (RNN/LSTM/GRU/Transformer)

More Tips

🏄‍♀️ Experiment Dashboard:

Set a log directory save path and run the Dashboard using it

Set a log directory save path, such as ./logs:

import swanlab 

swanlab.init(
  logdir="./logs"
)

Run the Dashboard using it:

$ swanlab watch --logdir ./logs_path
Set the Host and Port for the Dashboard
$ swanlab watch --host 0.0.0.0 --port 8080
Remotely access Dashboard

⚙️ Other:

argparse init swanlab.config

swanlab.config supports directly passing variables of type argparse.Namespace, such as:

import argparse
import swanlab

parser = argparse.ArgumentParser()
···
args = parser.parse_args()


swanlab.init(
    config=args
)

LICENSE

This project is currently licensed under Apache 2.0 License.

swanlab's People

Contributors

sakura-cat avatar feudalman avatar zeyi-lin avatar swpfy avatar kashiwabyte avatar little1d avatar clairdelunejs avatar indevn avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.