Skip to content

← deep_learning package

NetTransform

Transform a computational graph that involves neural net nodes into a functional form, with weights threaded out.

This node is for full manual control over NN optimization. The computational graph is your overall neural network forward pass, and starts with one or more placeholder nodes for the inputs, followed by some combination of neural net nodes and plain math ops as needed, and ends ultimately with the NetTransform node. Your graph can have positional inputs, which are Placeholder nodes whose names are listed in the desired order in the signature that goes with this node's graph port ("Graph [Signature]" in the UI or graph__signature in scripts). Additionally, you may have named (keyword-only) inputs, which are placeholders whose names are not listed in the signature; in this case your signature must look like "()" or "(myarg1, myarg2, )" for two positional arguments here named myarg1 and myarg2 (note in a script you can also pass this as a tuple as documented in GraphPort). The "this" output of this node can be wired into the NetInitialize and NetForward nodes to obtain the initial weights, and to apply those weights to some data. These two functions give full control over the gradient descent process, simply by applying the Calculate Gradient node to the NetForward function to obtain a function that yields gradients, invoking the resulting gradient function given some data and parameters, and then using the resulting gradients to update the parameters or parts thereof. Version 0.2.0

Ports/Properties

graph

Computational graph to transform.

  • verbose name: Graph
  • default value: None
  • port type: GraphPort
  • value type: Graph

graph__signature

Argument names of function to transform. The NetTransform node is used for manually performing gradient descent on a graph (representing an application of a neural network to some data and typically containing NN Layer nodes). The graph represents a function of some argument and therefore must contain at least one Placeholder node whose slotname must match the listed argument name. The remainder of the graph is an application of a network, either implemented in-place by chaining a series of NN layers after the placeholder, or by invoking a previously defined network using NetMaterialize and/or NetShare. The final output of your operation is taken to be the predictions of the network given the inputs. Note that in graphical UIs, the edge that goes into the "graph" input will be drawn in dotted style to indicate that this is not normal forward data flow, but that a graph (here your network application) is being passed verbatim to the NetTransform node.

  • verbose name: Graph [Signature]
  • default value: (inputs)
  • port type: Port
  • value type: object (can be None)

prefer_packets

Prefer to use packets to represent parameter sets instead of dicts.

  • verbose name: Prefer Packets
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

  • verbose name: Set Breakpoint (Debug Only)
  • default value: False
  • port type: BoolPort
  • value type: bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

  • verbose name: Metadata
  • default value: {}
  • port type: DictPort
  • value type: dict (can be None)