/home/mlunife/.local/share/swi-prolog/pack/bddem/prolog/bddem.pl
All Application Manual Name SummaryHelp

  • prolog
    • bddem.pl -- bddem
      • init_em/1
      • end_em/1
      • init_ex/2
      • end_ex/1
      • init/1
      • end/1
      • one/2
      • zero/2
      • and/4
      • or/4
      • ret_prob/3
      • ret_map_prob/4
      • ret_abd_prob/4
      • bdd_not/3
      • equality/4
      • em/9
      • add_var/4
      • add_abd_var/4
      • add_query_var/4
      • make_query_var/3
      • create_dot_string/3
      • create_dot/3
      • rand_seed/1
      • orc/3
      • onec/2
      • zeroc/2
      • andc/4
      • andcnf/4
      • bdd_notc/3
      • equalityc/4
      • ret_probc/3
      • initial_values/2
      • or_list/3
      • or_listc/3
      • gamma_sample/3
      • gauss_sample/3
      • uniform_sample/1
      • dirichlet_sample/2
      • symmetric_dirichlet_sample/3
      • discrete_sample/2
      • probability_dd/3
      • add_prod/4
      • add_sum/4
      • ret_strategy/4
      • debug_cudd_var/2
 em(++Context:int, ++RuleInfo:list, ++ListOfBDDs:list, ++EA:float, ++ER:float, ++Iterations:int, -LL:float, -Parameters:list, -ExampleProbabilities:list) is det
NumberOfHeads is a list of terms, one for each rule. Each term is either an integer, indicating the number of head atoms in the rule, or a list [N] where N is the number of head atoms. In the first case, the parameters of the rule are tunable, in the latter they are fixed.

Performs EM learning. Takes as input the Context, information on the rules, a list of BDDs each representing one example, the minimum absolute difference EA and relative difference ER between the log likelihood of examples in two different iterations and the maximum number of iterations Iterations. RuleInfo is a list of elements, one for each rule, with are either

  • an integer, indicating the number of heads, in which case the parameters of the corresponding rule should be randomized,
  • a list of floats, in which case the parameters should be set to those indicated in the list and not changed during learning (fixed parameters)
  • [a list of floats], in which case the initial values of the parameters should be set to those indicated in the list and changed during learning (initial values of the parameters) Returns the final log likelihood of examples LL, the list of new Parameters and a list with the final probabilities of each example. Parameters is a list whose elements are of the form [N,P] where N is the rule number and P is a list of probabilities, one for each head atom of rule N, in reverse order.