GithubHelp home page GithubHelp logo

lycokie / swanlab Goto Github PK

View Code? Open in Web Editor NEW

This project forked from swanhubx/swanlab

0.0 0.0 0.0 20.3 MB

🧐SwanLab: track and visualize all the pieces of your machine learning pipeline. 跟踪与可视化你的机器学习全流程

Home Page: https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic

License: Apache License 2.0

Shell 0.02% JavaScript 6.29% Python 52.31% TypeScript 0.03% HTML 0.06% Vue 40.53% SCSS 0.76%

swanlab's Introduction

SwanLab Library

Track and visualize all the pieces of your machine learning pipeline

license license pypi Download Github Discussion

SwanLab Head Image

👀 View Document | 👋 Join our WeChat

English | 中文

Table of Contents


Changelog

[24/03/19] 🔧 We fixed some issues, and prepare for the upcoming cloud version.(v0.2.4)

[24/03/12] 👽 We supported the line chart smoothing feature, supporting 3 different smoothing algorithms; we support comparing Images and Audio charts in Charts; we have improved swanlab.Image, supporting tensor as inputs.(v0.2.3)

[24/03/03] 🔧 We fixed some issues in v0.2.1 and added support for switching multimedia chart content by pressing keys.(v0.2.2)

[24/03/01] 🚀 Still Very Big Upgrade!We supported Text Chartto meet the needs of tasks in NLP, LLM, Agent and other scenarios; We have made a lot of optimizations to line chart's UI, legend, and rendering speed. We improved the rendering performance of Logs —— now viewing terminal printing information with 200k lines is also not lagging.(v0.2.1)

[24/02/08] 🔥 Very Big Upgrade! We supported Image ChartAudio Chart、Multi-Experiments Chart and a series of comprehensive optimizations and improvements! Please be sure to upgrade to the latest version via pip install -U swanlab.(v0.2.0)

Full Changelog

Upgrade to the latest version: pip install -U swanlab


Key Function

  • 📊 Visualize Training: visualize your entire training process.
  • 🚀 Multimedia Charts: log Image/Audio/Video/Text/object3D...
  • 🧪 Experiments GridView: compare your key metrics for inspiration faster.
  • ⚡️ Auto Save Environment Info: 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.


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={'epochs': 20, 'learning_rate': 0.01}, 
  # Specify the save path of the log file
  logdir="./logs",
)

# Model training code here...

# Log metrics over time for visualizing performance with swanlab.log
for epoch in range(1, swanlab.config.epochs):
    swanlab.log({"loss": loss})

For example, We wrote a simulation experiment script:

import swanlab
import random

offset = random.random() / 5

run = swanlab.init(
    experiment_name="Example",
    description="It's a ML experiment.",
    config={
        "learning_rate": 0.01,
        "epochs": 20,
    },
    logdir="./logs"
)

# Simulate the ML training process
for epoch in range(2, run.config.epochs):
    acc = 1 - 2**-epoch - random.random() / epoch - offset
    loss = 2**-epoch + random.random() / epoch + offset
    swanlab.log({"loss": loss, "accuracy": acc})
  1. Third, open the terminal and use the following command to start a SwanLab dashboard:
$ swanlab watch -l ./logs

SwanLab will give you a URL link (default is http://127.0.0.1:5092). Check the link to see the visualization results of your first experiment in the browser.


Tutorial

Get Started

Python API

CLI API

技巧


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)
UIE-Finetune how to use personal data to finetune UIE model and monitor training process through swanlab

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 nexisato 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.