Coder Social home page Coder Social logo

dash-live-model-training's Introduction

Dash Live Model Training Viewer

This is a demo of the Dash interactive Python framework developed by Plotly.

Dash abstracts away all of the technologies and protocols required to build an interactive web-based application and is a simple and effective way to bind a user interface around your Python code.

To learn more check out our documentation.

What does the app do?

For the majority of Deep Learning models, it is extremely helpful to keep track of the accuracy and loss as it is training. At the moment, the best application to do that is Tensorboard, which is a collection of visualization tools (metrics plots, image examples, graph representation, weight histogram, etc.) useful to debug and monitor the training of your model.

Dash's Live Model Training Viewer is a compact visualization app that monitors core metrics of your Tensorflow model during training. It complements the Tensorboard by offering the following:

  • Real-time visualization: The app is designed to visualize your metrics as they are updated inside your model.
  • Small and Lightweight: The viewer loads a small number of important visualization, so that it loads and runs quickly.
  • Simple to use: For simpler tensorflow models, all you need to do is to call add_eval to add the accuracy and cross entropy operations in the graph, and generate a log of the metrics using write_data. Both functions are inside tfutils.py, and examples are included in the examples directory.
  • Easy to modify: The app is stored inside one module, and is written in under 400 lines. You can quickly modify and improve the app without breaking anything.
  • Plotly Graphs and Dash Integration: Easily integrate the app into more complex Dash Apps, and includes all the tools found in Plotly graphs.

flowchart

At the moment, the logging only works for iterative Tensorflow models. We are planning to extend it for PyTorch. You are encouraged to port the logging function (which is a simple csv logging) to Keras, Tensorflow's high-level API, MXNet, etc.

How to use the app

The demo app shows how the viewer works by simulating the training process of a few basic models. If you want to use the full app with your own model, follow theses steps:

  1. Import the helper functions, add_eval() and write_data() from tfutils.py.
  2. Use add_eval() to add the accuracy and cross-entropy operations in your tensorflow graph, if they are not already present. It takes as input y_, the Tensor containing the true target, aka labels, and y, which contains the predicted targets, aka logits. It will return two variables, accuracy and cross_entropy.
  3. Create a feed dictionary (read more about it here) for both your training and validation batch.
  4. At every step, after running the session once, call write_data() to write the data in the log file. Use the feed dicts, accuracy and cross_entropy generated in the previous steps as input. If the output log file is renamed, update the LOGFILE variable inside app.py as well to reflect the changes.
  5. Run app.py, and open the given link.

Make sure that you correctly clone the repo with all the required libraries. You also need the latest version of Tensorflow and Sci-kit Learn.

Screenshots

screenshot1

screenshot2

dash-live-model-training's People

Stargazers

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