graph module

Full Documentation for hippynn.graphs.graph module. Click here for a summary page.

Core GraphModule that implements node computations

class GraphModule(required_inputs, nodes_to_compute)[source]

Bases: Module

classmethod from_evaluation_order(required_inputs, nodes_to_compute, evaluation_order)[source]

Construct a graph module with an explicit evaluation order, rather than one recomputed from the nodes.

Parameters:
  • required_inputs – inputs

  • nodes_to_compute – outputs

  • evaluation_order – evaluation order to key the module dict with; must contain the same set of nodes that compute_evaluation_order would produce for these inputs/outputs.

extra_repr()[source]

Return the extra representation of the module.

To print customized extra information, you should re-implement this method in your own modules. Both single-line and multi-line strings are acceptable.

forward(*input_values)[source]

Define the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

get_module(node)[source]
nodes_from_name(name)[source]

returns list of all matching nodes

print_structure(suppress=True)[source]

Pretty-print the structure of the nodes and links comprising this graph.

unique_node_from_name(name)[source]