Computational Graphs

I want to read about computational graphs, as they are related to neural networks and DL.

Date Created:
1 16

References



Notes


Computational Graphs:

  • The descriptive language of deep learning models
  • Functional description of the required computation
  • Can be instantiated to do two types of computation:
    • Forward computation
    • Backward computation

A node is a { tensor, matrix, vector, scalar } value.

An edge represents a function argument (and also data dependency). They are just pointers to nodes.

A node with an incoming edge is a function of that edge's tail node.

A node knows how to compute its value and the value of its derivative with respect to each argument (edge) times a derivative of an arbitrary input ,

Computation Graph Example

Functions can be nullary, unary, binary, ... n-ary. Often they are unary or binary.

Computed graphs are directed and acyclic (usually).

Variable names are just labelings of nodes.

  • Forward propagation
    • Loop over nodes in topological order
      • Compute the value of the node given its inputs
    • Given my inputs, make a prediction (or compute an error with respect to a target output)
  • Backward propagation
    • Loop over the nodes in reverse topological order starting with a final goal node
      • Compute the derivatives of final goal node value with respect to each edge's tail node
    • How does the output change if I make a small change to the inputs?

Forward Propagation Example

Constructing Graphs:

  • Static Declaration
    • Phase 1: define an architecture (maybe with some primitive flow control like loops and conditionals)
    • Phase 2: run a bunch of data through it to train the model and/or make predictions
    • Pros
      • Offline optimization/scheduling of graphs is powerful
      • Limits on operations mean better hardware support
    • Cons
      • Structured data (even simple stuff like sequences), even variable-sized data, is ugly
      • You effectively learn a new programming language (the Graph Language) and you write programs in that language to process data
    • Examples: Torch, Theano, TensorFlow

Comments

You have to be logged in to add a comment

User Comments

Insert Math Markup

ESC
About Inserting Math Content
Display Style:

Embed News Content

ESC
About Embedding News Content

Embed Youtube Video

ESC
Embedding Youtube Videos

Embed TikTok Video

ESC
Embedding TikTok Videos

Embed X Post

ESC
Embedding X Posts

Embed Instagram Post

ESC
Embedding Instagram Posts

Insert Details Element

ESC

Example Output:

Summary Title
You will be able to insert content here after confirming the title of the <details> element.

Insert Table

ESC
Customization
Align:
Preview:

Insert Horizontal Rule

#000000

Preview:


View Content At Different Sizes

ESC

Edit Style of Block Nodes

ESC

Edit the background color, default text color, margin, padding, and border of block nodes. Editable block nodes include paragraphs, headers, and lists.

#ffffff
#000000

Edit Selected Cells

Change the background color, vertical align, and borders of the cells in the current selection.

#ffffff
Vertical Align:
Border
#000000
Border Style:

Edit Table

ESC
Customization:
Align:

Upload Lexical State

ESC

Upload a .lexical file. If the file type matches the type of the current editor, then a preview will be shown below the file input.

Upload 3D Object

ESC

Upload Jupyter Notebook

ESC

Upload a Jupyter notebook and embed the resulting HTML in the text editor.

Insert Custom HTML

ESC

Edit Image Background Color

ESC
#ffffff

Insert Columns Layout

ESC
Column Type:

Select Code Language

ESC
Select Coding Language

Insert Chart

ESC

Use the search box below

Upload Previous Version of Article State

ESC