question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a construct_graph function to Tensors that creates a visual graph of a network.

Example:

"
 /‾‾‾\
| out |
 \___/
   Λ
   |
   |
   |
 |‾‾‾|
 | + |
 |___|
   Λ
   |
   |‾‾‾‾‾‾‾|
   |       |
   |       |
 /‾‾‾\   /‾‾‾\
|  Z  | |  K  |
 \___/   \___/
           Λ
           |
           |
           |
         |‾‾‾|
         | * |
         |___|
           Λ
           |
      |‾‾‾‾‾‾‾‾‾|
      |         |
      |         |
    /‾‾‾\    /‾‾‾\
   |  X  |  |  Y  |
    \___/    \___/
"

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:19 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
davidmascharkacommented, Mar 23, 2018

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.

0reactions
petarmhgcommented, Jul 16, 2018

Implemented in #70

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found