当尝试为Matlab测试Bayes Net Toolbox时出现错误,我的操作与此处显示的安装相同,但出现错误(对于MATLAB 2018a):我将ffa.m和mfa.m文件更改为isfinite当我尝试在错误提到的文件中更改函数CPD_to_CPT的名称时,情况变得更糟,什么也没计算,错误仍然存在。
>> test_BNT
ll =
1.0e-10 *
0.2822 0.1697
cycle 1 lik -51.5585
cycle 2 lik -45.0863
cycle 3 lik -42.9953
EM iteration 1, ll = -51.5585
EM iteration 2, ll = -45.0863
EM iteration 3, ll = -42.9953
EM iteration 1, ll = -81.0153
EM iteration 2, ll = -67.2658
EM iteration 3, ll = -60.1511
EM iteration 4, ll = -56.6276
EM iteration 5, ll = -54.9433
100 samples, 1dp 1, 2dp 0, 3dp 0, err 0.070767
200 samples, 1dp 1, 2dp 0, 3dp 0, err 0.052974
300 samples, 1dp 1, 2dp 0, 3dp 0, err 0.058912
400 samples, 1dp 1, 2dp 1, 3dp 0, err 0.018224
500 samples, 1dp 1, 2dp 1, 3dp 0, err 0.015127
cycle 1 log likelihood -94.4095
cycle 2 log likelihood -73.8294
cycle 3 log likelihood -67.4196
EM iteration 1, ll = -94.4095
EM iteration 2, ll = -73.8294
EM iteration 3, ll = -67.4196
EM iteration 1, ll = -322.9274
EM iteration 2, ll = -48.2780
EM iteration 3, ll = -44.9882
EM iteration 4, ll = -39.3452
EM iteration 5, ll = -31.8845
mixexp2: loglik before learning -322.927442, after 5 iters -31.884507
ans =
0.6785
Cycle 1 Error 37.305788
Cycle 2 Error 19.821065
Cycle 3 Error 19.801395
Maximum number of iterations has been exceeded
EM iteration 1, ll = -37.3058
EM iteration 2, ll = -19.8211
EM iteration 3, ll = -19.8014
mpe =
1×6 cell array
{[1]} {[1]} {[2]} {[2]} {[2]} {[1]}
mpe =
1×6 cell array
{[1]} {[1]} {[2]} {[2]} {[2]} {[1]}
mpe =
1×6 cell array
{[1]} {[1]} {[2]} {[2]} {[2]} {[1]}
mpe =
1×6 cell array
{[1]} {[1]} {[2]} {[2]} {[2]} {[1]}
mpe =
1×6 cell array
{[1]} {[1]} {[2]} {[2]} {[2]} {[1]}
Elapsed time is 0.004768 seconds.
Error: File: CPD_to_CPT.m Line: 36 Column: 16
Function with duplicate name "CPD_to_CPT" cannot be defined.
Error in discrete_CPD/convert_to_pot (line 14)
CPT1 = CPD_to_CPT(CPD);
Error in jtree_inf_engine/enter_evidence (line 57)
pot{n} = convert_to_pot(bnet.CPD{e}, pot_type, fam(:), evidence);
Error in qmr1 (line 84)
tic; [engine{2}, ll(2)] = enter_evidence(engine{2}, big_evidence); toc
Error in test_BNT (line 23)
qmr1