jpt.inference ============= .. py:module:: jpt.inference Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/jpt/inference/likelihood/index /autoapi/jpt/inference/mpe/index Classes ------- .. autoapisummary:: jpt.inference.MPESolver Package Contents ---------------- .. py:class:: MPESolver(distributions: jpt.variables.VariableMap, likelihood_divisor: float = None) Solver for k-MPE inference about n independent variables This algorithm iteratively constructs all ``k`` most 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. .. py:attribute:: distributions :type: jpt.variables.VariableMap .. py:attribute:: domains .. py:attribute:: constraints .. py:attribute:: lb .. py:method:: likelihood(solution: BnBSolution) .. py:method:: is_goal_state(state: MPEState) -> bool .. py:method:: variable_order(state: MPEState = None) -> Iterator[jpt.variables.Variable] :param state: The state to start from :return: An iterator over free variables for a state sorted by number of different possible states (lowest amount of values first). .. py:method:: solve(k: int = 0) -> Iterator[List[jpt.variables.ValueAssignment]] Generate ``k`` MPE states with decreasing probability. :return: