about summary refs log tree commit diff
path: root/sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m
diff options
context:
space:
mode:
Diffstat (limited to 'sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m')
-rw-r--r--sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m b/sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m
new file mode 100644
index 00000000..9fe4d0ac
--- /dev/null
+++ b/sourcecodes/bnt-master/BNT/CPDs/@hhmm2Q_CPD/maximize_params.m
@@ -0,0 +1,10 @@
+function CPD = maximize_params(CPD, temp)
+% MAXIMIZE_PARAMS Set the params of a hhmmQ node to their ML/MAP values.
+% CPD = maximize_params(CPD, temperature)
+
+if sum(CPD.start_counts(:)) > 0
+  CPD.startprob = mk_stochastic(CPD.start_counts);
+end
+if sum(CPD.trans_counts(:)) > 0
+  CPD.transprob = mk_stochastic(CPD.trans_counts);
+end