factor_agent.gate.graph.Graph#

class Graph(nodes, classes=None)[source]#

Bases: object

A factor graph in topological order; the last node is the factor.

Methods#

Graph.build

Rebuild the operators and return (factor, every new operator).

Graph.build_nodes

Rebuild the operators as build does and return (the operator of every node, in order, every new operator).

Graph.fingerprint

Return the SHA-256 of the canonical graph.

Graph.from_json

Rebuild a graph from to_json; every node must name one of classes (Vocabulary.classes).

Graph.ranking

Return the SHA-256 of the canonical graph up to what keeps or reverses its cross-sectional ranking.

Graph.record

Record every operator output depends on, its inputs and loops first, under vocabulary's names.

Graph.to_json

Return the nodes as JSON-ready lists.

Graph.without_fills

Return the graph with every SetInfOrNanToValue replaced by its input.

Attributes#

Graph.classes = None#

The class of every operator name, from the vocabulary; None for a graph that is never built.

Graph.input_names#

The dataset columns the graph reads, sorted.

Graph.nodes#