GithubHelp home page GithubHelp logo

yefengbar / visualdl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paddlepaddle/visualdl

0.0 2.0 0.0 10.17 MB

A platform to visualize the deep learning process.

Home Page: http://visualdl.paddlepaddle.org

License: Apache License 2.0

Shell 3.60% CMake 4.27% JavaScript 16.71% Vue 27.26% CSS 1.35% HTML 0.13% Python 20.78% C++ 25.90%

visualdl's Introduction

Build Status Documentation Status Release License

Introduction

VisualDL is a deep learning visualization tool that can help design deep learning jobs. It includes features such as scalar, parameter distribution, model structure and image visualization. Currently it is being developed at a high pace. New features will be continuously added.

At present, most DNN frameworks use Python as their primary language. VisualDL supports Python by nature. Users can get plentiful visualization results by simply add a few lines of Python code into their model before training.

Besides Python SDK, VisualDL was writen in C++ on the low level. It also provides C++ SDK that can be integrated into other platforms.

Component

VisualDL now provides 4 components:

  • graph
  • scalar
  • image
  • histogram

Graph

Graph is compatible with ONNX (Open Neural Network Exchange), Cooperated with Python SDK, VisualDL can be compatible with most major DNN frameworks, including PaddlePaddle, PyTorch and MXNet.

Scalar

Scalar can be used to show the trends of error during training.

Image

Image can be used to visualize any tensor or intermediate generated image.

Histogram

Histogram can be used to visualize parameter distribution and trends for any tensor.

Quick Start

To give the VisualDL a quick test, please use the following commands.

# Install the VisualDL. Preferably under a virtual environment.
pip install --upgrade visualdl

# run a demo, vdl_create_scratch_log will create logs for testing.
vdl_create_scratch_log
visualDL --logdir=scratch_log --port=8080

# visit http://127.0.0.1:8080

SDK

VisualDL provides both Python SDK and C++ SDK in order to fit more use cases.

Python SDK

VisualDL now supports both Python 2 and Python 3. Below is an example of creating a simple Scalar component and inserting data from different timestamps:

import random
from visualdl import LogWriter

logdir = "./tmp"
logger = LogWriter(logdir, sync_cycle=10000)

# mark the components with 'train' label.
with logger.mode("train"):
    # create a scalar component called 'scalars/scalar0'
    scalar0 = logger.scalar("scalars/scalar0")

# add some records during DL model running.
for step in range(100):
    scalar0.add_record(step, random.random())

C++ SDK

Here is the C++ SDK identical to the Python SDK example above:

#include <cstdlib>
#include <string>
#include "visualdl/logic/sdk.h"

namespace vs = visualdl;
namespace cp = visualdl::components;

int main() {
  const std::string dir = "./tmp";
  vs::LogWriter logger(dir, 10000);

  logger.SetMode("train");
  auto tablet = logger.AddTablet("scalars/scalar0");

  cp::Scalar<float> scalar0(tablet);

  for (int step = 0; step < 1000; step++) {
    float v = (float)std::rand() / RAND_MAX;
    scalar0.AddRecord(step, v);
  }

  return 0;
}

Launch Board

After some logs have been generated during training, users can launch board to see real-time data visualization.

visualDL --logdir <some log dir>

Board also supports the parameters below for remote access:

  • --host set IP
  • --port set port
  • --model_pb specify ONNX format for model file

The VisualDL Graphing system uses GraphViz to visualize the ONNX model. To enable the VisualDL Graph feature, please install GraphViz

How to install from pypi

pip install --upgrade visualdl

How to build and install locally

git clone https://github.com/PaddlePaddle/VisualDL.git
cd VisualDL

python setup.py bdist_wheel
pip install --upgrade dist/visualdl-*.whl

Run a demo from scratch

# vdl_create_scratch_log is a helper commend that creates mock data.
vdl_create_scratch_log 
visualDL --logdir=scratch_log --port=8080

that will start a server locally on port 8080, then you can visit http://127.0.0.1:8080 the see the visualdl board.

Contribute

VisualDL is initially created by PaddlePaddle and ECharts. We welcome everyone to use, comment and contribute to Visual DL :)

visualdl's People

Contributors

bingblog avatar cs2be avatar daming-lu avatar deqingli avatar hsen-dev avatar jacquesqiao avatar jetfuel avatar makefile avatar nickyfantasy avatar oraoto avatar superjomn avatar wlbksy avatar

Watchers

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