sketchgraphs_models.autoconstraint.eval

Evaluation script for auto-constraint model.

Classes

AutoConstraintPrediction(model, …[, …])

ConstraintGenerator(node_ops[, max_edges, …])

InferenceRequest(node_ops, edge_ops, …)

PriorityItem(priority, item)

Functions

sketchgraphs_models.autoconstraint.eval.feature_from_request(request: sketchgraphs_models.autoconstraint.eval.InferenceRequest)
sketchgraphs_models.autoconstraint.eval.load_pickle_ops(path)
sketchgraphs_models.autoconstraint.eval.load_sampling_model(model_path)
sketchgraphs_models.autoconstraint.eval.main()
sketchgraphs_models.autoconstraint.eval.mask_from_node_types(node_ops)

Creates a mask based on the node types for a given node sequence.

A mask is a tensor of size [(num_nodes) * (num_nodes + 1) / 2, num_edge_tyes], which represents the valid constraints between different nodes in the graph. It is formed by concatenating, for each node, tensors representing the valid edge types between itself and any of the previous nodes in the graph (including itself), where the validity is encoded as having a zero at the given location for valid edge types, and a -inf at locations for invalid edge types.

sketchgraphs_models.autoconstraint.eval.mask_from_satisfied(node_ops)
sketchgraphs_models.autoconstraint.eval.split_ops(ops)
sketchgraphs_models.autoconstraint.eval.valid_constraint_idx(node_ops, entities, partner, current)