pystruct.inference.inference_dai

pystruct.inference.inference_dai(unary_potentials, pairwise_potentials, edges, return_energy=False, alg='jt')

Inference with LibDAI backend.

Parameters :

unary_potentials : nd-array

Unary potentials of energy function.

pairwise_potentials : nd-array

Pairwise potentials of energy function.

edges : nd-array

Edges of energy function.

alg : string, (default=’jt’)

Inference algorithm to use. Defaults to Junction Tree. THIS WILL BLOW UP for loopy graphs.

Returns :

labels : nd-array

Approximate (usually) MAP variable assignment.