Graph Diagrams
See original GitHub issueAdd a construct_graph
function to Tensors that creates a visual graph of a network.
Example:
"
/‾‾‾\
| out |
\___/
Λ
|
|
|
|‾‾‾|
| + |
|___|
Λ
|
|‾‾‾‾‾‾‾|
| |
| |
/‾‾‾\ /‾‾‾\
| Z | | K |
\___/ \___/
Λ
|
|
|
|‾‾‾|
| * |
|___|
Λ
|
|‾‾‾‾‾‾‾‾‾|
| |
| |
/‾‾‾\ /‾‾‾\
| X | | Y |
\___/ \___/
"
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:19 (5 by maintainers)
Top Results From Across the Web
Graph Maker - Create online charts & diagrams in minutes
Easily create your customized charts & diagrams with Canva's free online graph maker. Choose from 20+ chart types & hundreds of templates.
Read more >Online Graph Maker - Create Your Own Graphs & Charts | Visme
Create over 30+ charts & diagrams with ease in Visme's graph maker. Access customizable templates, live data integration and interactive graph capabilities.
Read more >Graphs and Charts | SkillsYouNeed
Bar graphs to show numbers that are independent of each other. · Pie charts to show you how a whole is divided into...
Read more >Types of Graphs and Charts and Their Uses - Intellspot
Every type of graph is a visual representation of data on diagram plots (ex. bar, pie, line chart) that show different types of...
Read more >Create a Graph Classic-NCES Kids' Zone
Here you will find four different graphs and charts for you to consider. Maybe it will help explain what you are trying to...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Definitely a nice feature to have. A couple suggestions:
Rendering
Figuring out positions for your variables is definitely not an easy problem. You’re essentially trying to solve an entire typesetting problem. It’s very interesting, but there’s a ton of existing work that you can (and should unless you’re just super interested in typesetting algorithms) take advantage of to handle the rendering for you.
One great library is Graphviz which I personally use for typesetting graphs. Since you’re trying to draw a computational graph, a graph rendering library is probably a good place to start. It’s relatively easy to get up-to-speed with. You’d probably want to use something like pydot, which is a Python interface to the DOT language, which is super useful for directed graphs (like a computational graph).
Another advantage is it looks prettier than ASCII art (not that there’s anything wrong with ASCII art).
Creating the Graph
You can leverage the fact that you have to create a computational graph of anything you’re interested in rendering anyway, so you don’t really need to store any extra information. You can essentially just follow the path of
null_gradients
and use that to construct and render your graph object.Implemented in #70