pystruct.inference.inference_qpbo

pystruct.inference.inference_qpbo(unary_potentials, pairwise_potentials, edges, **kwargs)[source]

Inference with PyQPBO backend.

Used QPBO-I based move-making for undergenerating inference.

Parameters:

unary_potentials : nd-array, shape (n_nodes, n_nodes)

Unary potentials of energy function.

pairwise_potentials : nd-array, shape (n_states, n_states) or (n_states, n_states, n_edges).

Pairwise potentials of energy function. If the first case, edge potentials are assumed to be the same for all edges. In the second case, the sequence needs to correspond to the edges.

edges : nd-array, shape (n_edges, 2)

Graph edges for pairwise potentials, given as pair of node indices. As pairwise potentials are not assumed to be symmetric, the direction of the edge matters.

Returns:

labels : nd-array

Approximate (usually) MAP variable assignment.