From e3f7237ffcb19f19db3b68777b5a94b89e07f66a Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Thu, 13 Sep 2018 23:59:20 -0500 Subject: New parameter learning options The main change here is in the parameter learning methods. The parameters that are learned at first (i.e., if there is no evidence) are the distributions that are found directly in the data. I had to create or significantly modify several BNT files for this. If there is evidence, the parameters are learned using a Dirichlet prior. This only required a couple of small changes to the BNW parameter learning files. --- sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m') diff --git a/sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m b/sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m index 728302d4..a41a23d9 100644 --- a/sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m +++ b/sourcecodes/bnt-master/BNT/CPDs/@tabular_CPD/tabular_CPD.m @@ -9,6 +9,7 @@ function CPD = tabular_CPD(bnet, self, varargin) % - T means use table T; it will be reshaped to the size of node's family. % - 'rnd' creates rnd params (drawn from uniform) % - 'unif' creates a uniform distribution +% CPT_orig - specifies the distribution based on original data % adjustable - 0 means don't adjust the parameters during learning [1] % prior_type - defines type of prior ['none'] % - 'none' means do ML estimation @@ -60,6 +61,7 @@ CPD.sparse = 0; % set defaults CPD.CPT = mk_stochastic(myrand(fam_sz)); +CPD.CPT_orig = mk_stochastic(myrand(ns([self]))); CPD.adjustable = 1; CPD.prior_type = 'none'; dirichlet_type = 'BDeu'; @@ -158,6 +160,7 @@ function CPD = init_fields() % or create it from scratch. (Matlab requires this.) CPD.CPT = []; +CPD.CPT_orig = []; CPD.sizes = []; CPD.prior_type = []; CPD.dirichlet = []; -- cgit 1.4.1