Skip to content

Latest commit

 

History

History
42 lines (26 loc) · 3.76 KB

WEEK-10-13.md

File metadata and controls

42 lines (26 loc) · 3.76 KB

Week of 10/13/2019

Brief Reminder: We are building Vizstack: a stack of programming tools that make code visual, simplifying complexity by rendering any data structure from any program in any language. Consider the last time you encountered an unfamilar codebase or had to debug a nasty algorithm. We believe that this code complexity can be tamed with better developer tools. We believe the time is right to reinvent the programming experience, so that developers can build bigger, faster, safer, and more intricate software.

To learn more, visit the home page.

A crucial part of our visualization library is being able to visualize graphs. For various reasons outlined here, we've decided to develop our own graph layout library called nodal.

1. Finalize nodal landing page content & repo

Landing Page: https://vizstack.github.io/nodal/

This week, we wanted to write the main content for the Nodal landing page, including:

  • Guides: introduction, getting started, etc.
  • Examples: to show off what's possible to build
  • API: detailed documentation that algorithm builders can consult

It was quite the challenge! Especially since we haven't worked with Gatsby.js extensively before, there was a lot of trial-and-error to figure out how to integrate our website theme with the docz theme and the typedoc theme.

After thorough research, we settled on this stack because:

  • docz: It's really nice to be able to generate documentation from Markdown files, rather than having to create individual pages. We were trying to go for a professional looking solution, and considered Gitbook and Vuepress, but ultimately decided to go with docz since it integrates nicely into Gatsby.
  • typedoc: Something we've seen other projects do is manually create their API docs, e.g. in Gitbook or Vuepress. We really didn't want to do this, as it violates a fundamental principle: "Don't repeat yourself!" We already had good documentation and types in our Typescript code, so wanted an auto-generated solution. Although we're not 100% thrilled with the output of typedoc, it get's the job done, so we're using it.

guides

api

2. Prototype vz-pytorch computation graph visualizer

One of the most exciting thing for us this week was that we actually got to see our hard work on nodal in action. After we integrated it into our @vizstack/core, we were able to start building applications with DagLayout (and the other Fragments). We coded up a prototype for neural network interpretability. Right now, it only shows the structure of the graph, but eventually each node will have other data about the PyTorch Module as well. This was the perfect use case that uses many components of the Vizstack suite of tools: core, vz-logger, and nodal.

vz-pytorch

The edges aren't the most pretty right now, because we haven't implemented orthogonal edge routing yet. But we're able to get a visualization with usable data, and this can theoretically extend to any model a user wants to visualize. All they have to do is:

  1. Create a Tracker object.
  2. Pass their model using tracker.model(model).
  3. Call tracker.start()
  4. Call model(inputs) as much as they want; every call is tracked.
  5. Call graph = tracker.stop() to build the computation graph object. This object has __view__() defined to produce the computation graph using Vizstack.

vz-pytorch prototype: https://github.com/vizstack/vz-pytorch