Show HN: Mycelium – A graph viewer library for neural networks
Hey HN, we&#x27;re happy to release Mycelium, a JavaScript library for creating graph visualizations of machine learning models or any other directed acyclic graphs.<p>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].<p>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.<p>The library was heavily inspired by Lutz Roeder&#x27;s Netron viewer [2] but adds additional features:<p>* Hierarchical grouping of nodes&#x2F;modules to visualize and explore large graphs more efficiently.<p>* An UI framework that allows users to customize the contents of each node and tooltip.<p>* Can be embedded into any web application or framework by mounting it directly to the DOM (similar to the Monaco text editor).<p>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!<p>Mycelium was developed for my project at Apple together with Xiaoyi Zhang and Fred Hohman, with advice from Dominik Moritz and Donghao Ren. I&#x27;m happy to answer any questions!<p>---<p>Shameless plug: I&#x27;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!<p>[0](<a href="https:&#x2F;&#x2F;machinelearning.apple.com&#x2F;research&#x2F;talaria" rel="nofollow">https:&#x2F;&#x2F;machinelearning.apple.com&#x2F;research&#x2F;talaria</a><p>[1](<a href="https:&#x2F;&#x2F;machinelearning.apple.com&#x2F;research&#x2F;introducing-apple-foundation-models" rel="nofollow">https:&#x2F;&#x2F;machinelearning.apple.com&#x2F;research&#x2F;introducing-apple...</a>)<p>[2](<a href="https:&#x2F;&#x2F;github.com&#x2F;lutzroeder&#x2F;netron">https:&#x2F;&#x2F;github.com&#x2F;lutzroeder&#x2F;netron</a>)<p>[3](<a href="https:&#x2F;&#x2F;research.google&#x2F;blog&#x2F;model-explorer&#x2F;" rel="nofollow">https:&#x2F;&#x2F;research.google&#x2F;blog&#x2F;model-explorer&#x2F;</a>)<p>[4](<a href="https:&#x2F;&#x2F;github.com&#x2F;dagrejs&#x2F;dagre">https:&#x2F;&#x2F;github.com&#x2F;dagrejs&#x2F;dagre</a>)<p>[5](<a href="https:&#x2F;&#x2F;jgoertler.com" rel="nofollow">https:&#x2F;&#x2F;jgoertler.com</a>)<p>[6](<a href="https:&#x2F;&#x2F;distill.pub&#x2F;2019&#x2F;visual-exploration-gaussian-processes&#x2F;" rel="nofollow">https:&#x2F;&#x2F;distill.pub&#x2F;2019&#x2F;visual-exploration-gaussian-process...</a>)