Hey HN, we're happy to release Mycelium, a JavaScript library for creating graph visualizations of machine learning models or any other directed acyclic graphs.
Mycelium powers the graph viewer of the Talaria [0] a research model visualization and optimization system, which was used to optimize the efficiency of Apple Foundation Models [1].
Everything works entirely on the client-side in the browser — we provide a rudimentary ONNX loader out of the box, which you can try by dragging model files into our website. It is also simple to define loaders for your own model formats.
The library was heavily inspired by Lutz Roeder's Netron viewer [2] but adds additional features:
* Hierarchical grouping of nodes/modules to visualize and explore large graphs more efficiently.
* An UI framework that allows users to customize the contents of each node and tooltip.
* Can be embedded into any web application or framework by mounting it directly to the DOM (similar to the Monaco text editor).
In contrast to Model Explorer [3] by Google Research (which uses WebGL) we decided to stick with an SVG-based renderer because it gives us more flexibility for the representation of the data. Plus, we found that the limiting factor for usability, in our case, is not rendering performance but the time it takes to compute the layout of the graph (we use Dagre [4] as a layout engine). Being able to hierarchically group nodes alleviates this to a large degree!
Mycelium was developed for my project at Apple together with Xiaoyi Zhang and Fred Hohman, with advice from Dominik Moritz and Donghao Ren. I'm happy to answer any questions!
---
Shameless plug: I'm working as an independent research scientist and software engineer [5]. I love working on hand-tailored visualization systems and interactive articles [6] — please feel free to reach out if that is interesting to you too!
[0](https://machinelearning.apple.com/research/talaria
[1](https://machinelearning.apple.com/research/introducing-apple...)
[2](https://github.com/lutzroeder/netron)
[3](https://research.google/blog/model-explorer/)
[4](https://github.com/dagrejs/dagre)
[5](https://jgoertler.com)
[6](https://distill.pub/2019/visual-exploration-gaussian-process...)