Closed imatsuzaki closed 4 years ago
Not yet, but we definitely should add one soon!
We plan on integrating with networkx for now. That way you can easily view the network visualization inside of a colab/Jupiter notebook. We have a PR from a (recently) exintern who did network visualization of "tree like" networks, but we should definitely extend it to arbitrary networks.
Doing an integration into tensorboard would be great, but we have no plans of doing that yet.
We plan on integrating with nxgraph for now. That way you can easily view the network visualization inside of a colab/Jupiter notebook.
That's great! It will be helpful to construct tensor network! Looking forward to PR and release. I think integrating with nxgraph will be enough.
Should I close this issue?
Keep it open, we'll use it to track progress
Thanks for raising this issue, I also think should stay open until a general solution is found. Regarding the networkx visualization, I have a jupyter notebook with some example visualizations on my PR that you can check if you like.
A problem with this implementation is that I code explicitly the coordinates of each node in the graph which might be hard to do for arbitrary networks. For trees it is possible to find the levels with a BFS but I cannot think of a general way to define coordinates. I do not have much experience on graph plotting but perhaps there are ways or libraries to do a plot that looks reasonably well automatically, without having to code every coordinate. This might be worth checking. Also, I would find nice to have interactive graphs, where you can click a node and hide/show the nodes connected to it. I think that Tensorboard might be able to do this.
*nxgraph-> networkx.
Sorry, I wrote the wrong name
I appreciate discussing about visualization, and also looking forward to PR.
I do not also have much experience on graph, but graphviz can be helpful to create interactive tensor network visualization.
Implementing tensorboard visualization may be hard because it is based on tensorflow graph, and it is not suitable to this library because of other runtime, like JAX.
I would be happy to help with working on a tensor viz (vide my interest in tensor diagrams).
There is a super-simple thing in JSFiddle, with D3.js (https://jsfiddle.net/stared/8huz5gy7/):
However, for a general one I would like to make sure:
Hey that'd be awesome! We'd welcome a PR for this. I'm not a JS developer, so really anything that looks nice would be ok by me.
If you want to make a JS visualization tool, go ahead and make a new directory under visualization/js/
.
Ok cool so we have a TensorNetwork
-> graphviz.Graph
shim working. I think this will be a good enough for now.
It would also be cool to have a gif generator so you can visualize the contraction order of the network.
0.0.4 is out now. You can use g = tensornetwork.to_graphviz(net)
to create an isomorphic graphviz object. From there you can pretty easily see the visualization.
The current version does not seem to support net = tensornetwork.TensorNetwork(), so how can I visualize the network from a set of nodes I created?
Sorry for the late response!
To visialize the graph in the latest API, you can simple do
tn.to_graphvis(list_of_nodes)
Is there any way to visualize network ?
This library based on TensoFlow, so it may be suitable to use tensorboard. However I think we need to implement visualization code for tensoboard, and it will be hard.