jpt.inference.mpe
Classes
Solver for k-MPE inference about n independent variables |
Module Contents
- class jpt.inference.mpe.MPEState(assignment: jpt.variables.VariableMap)
- assignment
- latest_variable = None
- copy()
- __repr__()
- class jpt.inference.mpe.BnBNode(solver, state, actual_cost)
-
- variable: jpt.variables.Variable = None
- actual_cost
- step_cost = 0
- _generate_next()
- pop()
- property cost
- property free_variables
- class jpt.inference.mpe.MPESolver(distributions: jpt.variables.VariableMap, likelihood_divisor: float = None)
Solver for k-MPE inference about n independent variables
This algorithm iteratively constructs all
kmost probable explanations in descending order by performing a branch-and-bound search in the space of atomic areas of the respective distributions. In constrast to classic BnB search, we do not throw away the pruned states but save them in a priority queue, where we can continue the search for the subsequent 2nd, 3rd, …, k-th best solution.- distributions: jpt.variables.VariableMap
- domains
- constraints
- lb
- likelihood(solution: BnBSolution)
- variable_order(state: MPEState = None) Iterator[jpt.variables.Variable]
- Parameters:
state – The state to start from
- Returns:
An iterator over free variables for a state sorted by number of different possible states (lowest amount of values first).
- solve(k: int = 0) Iterator[List[jpt.variables.ValueAssignment]]
Generate
kMPE states with decreasing probability.- Returns: