sig
module Varstate :
sig
exception NoMoreStates
val get_offsets : int array -> int array
val idx_to_varstate : int array -> int -> int array
val varstate_to_idx : int array -> int array -> int
val state_to_idx : int array -> int array -> int array -> int
val incstate : int array -> int array -> int list -> unit
val map_state : int array -> int list -> (int array -> 'a) -> 'a list
val iter_state : int array -> int list -> (int array -> 'a) -> unit
end
module Factor :
sig
type variable = int
type varvalue = int
type condition = bool * Mn.Factor.variable * Mn.Factor.varvalue
type feature =
Factor.feature = {
cond : Mn.Factor.condition array;
weight_id : int;
mutable weight : float;
}
type tree =
Factor.tree =
Leaf of float
| Vertex of Mn.Factor.variable * Mn.Factor.varvalue *
Mn.Factor.tree * Mn.Factor.tree
type factor =
Factor.factor =
Feature of Mn.Factor.feature
| FeatureSet of Mn.Factor.feature list
| Table of Mn.Factor.variable array * int array * float array
| Tree of Mn.Factor.tree
| Const of float
val simple_cond_cmp : Mn.Factor.condition -> Mn.Factor.condition -> int
val remove_redundant_conds :
Mn.Factor.condition list -> Mn.Factor.condition list
val condl_to_valsetl :
int array -> Mn.Factor.condition list -> (int * bool array) list
val fmatch :
Mn.Factor.varvalue array -> Mn.Factor.condition array -> bool
val fweight : Mn.Factor.varvalue array -> Mn.Factor.feature -> float
val log_value : Mn.Factor.varvalue array -> Mn.Factor.factor -> float
val expected_log_value :
Mn.Factor.factor -> float array array -> float array array -> float
val numparams : Mn.Factor.factor -> int
val simplify_feature :
Mn.Factor.varvalue array -> Mn.Factor.feature -> Mn.Factor.feature
val simplify :
Mn.Factor.varvalue array -> Mn.Factor.factor -> Mn.Factor.factor
val tree_to_features :
Mn.Factor.condition list -> Mn.Factor.tree -> Mn.Factor.feature list
val table_to_features :
Mn.Factor.variable array * int array * float array ->
Mn.Factor.feature list
val to_features : Mn.Factor.factor -> Mn.Factor.feature list
val set_weights :
float array -> int -> Mn.Factor.factor -> Mn.Factor.factor * int
val vars : Mn.Factor.factor -> Mn.Factor.variable list
val feature_set_vars :
Mn.Factor.feature list -> Mn.Factor.variable list
val tree_vars : Mn.Factor.tree -> Mn.Factor.variable list
val to_table : int array -> Mn.Factor.factor -> Mn.Factor.factor
val copy : Mn.Factor.factor -> Mn.Factor.factor
val rescale : float -> Mn.Factor.factor -> Mn.Factor.factor
val output_factor : Pervasives.out_channel -> Mn.Factor.factor -> unit
val output_feature :
Pervasives.out_channel -> Mn.Factor.feature -> unit
val output_featurelist :
Pervasives.out_channel -> Mn.Factor.feature list -> unit
val output_tree :
Pervasives.out_channel -> string -> Mn.Factor.tree -> unit
module MP :
sig
type pcond = Mn.Factor.condition
type pfeature = int * float * Mn.Factor.MP.pcond list
type pfeaturelist = Mn.Factor.MP.pfeature list
type ptree =
MnParseTypes.ptree =
PLeaf of float
| PVertex of int * int * Mn.Factor.MP.ptree * Mn.Factor.MP.ptree
type pfactor =
MnParseTypes.pfactor =
PFeatureSet of Mn.Factor.MP.pfeaturelist
| PFeatureTable of Mn.Factor.MP.pfeaturelist
| PFeatureTree of Mn.Factor.MP.ptree
| PFeature of Mn.Factor.MP.pfeature
type pmn =
MnParseTypes.pmn = {
factors : Mn.Factor.MP.pfactor list;
weights : (int * float) list;
}
end
val pfactor_to_factor :
int array -> Mn.Factor.MP.pfactor -> Mn.Factor.factor
end
type network = {
schema : int array;
factors : Mn.Factor.factor array;
var_to_factors : Mn.Factor.factor list array;
}
val pll : Mn.network -> Mn.Factor.varvalue array -> float
val numvars : Mn.network -> int
val numweights : Mn.network -> int
val get_range : Mn.network -> int -> int
val schema : Mn.network -> int array
val factors : Mn.network -> Mn.Factor.factor array
val create : int array -> Mn.Factor.factor array -> Mn.network
val raw_logprob : Mn.network -> Mn.Factor.varvalue array -> float
val mb_logdist :
Mn.network -> Mn.Factor.varvalue array -> int -> float array
val simplify : Mn.network -> Mn.Factor.varvalue array -> Mn.network
val to_features : Mn.network -> Mn.Factor.feature list
val set_weights : Mn.network -> float array -> unit
val filename_is_mn : string -> bool
val filename_is_uai : string -> bool
val input_features_lex : Lexing.lexbuf -> Mn.Factor.feature list
val input_features : Pervasives.in_channel -> Mn.Factor.feature list
val load : Pervasives.in_channel -> Mn.network
val output : Pervasives.out_channel -> Mn.network -> unit
val load_uai : Pervasives.in_channel -> Mn.network
val output_uai : Pervasives.out_channel -> Mn.network -> unit
val load_auto : string -> Mn.network
val write_auto : string -> Mn.network -> unit
end