pmtk3
pmtk3 copied to clipboard
Possible issue with mrfToMrf2 logic
From [email protected] on September 03, 2012 17:22:20
What steps will reproduce the problem? 1. See attached file mrfToMrf2Issue.m What is the expected output? What do you see instead? The function testMisconceptionMRFtoMRF2() should generate the same output as the testMisconceptionMRF(). Instead, the edge potentials in the mrf2 model appear to be getting set up incorrectly. What version / revision of the product are you using? On what operating system? pmtk3-3jan11.zip - uploaded january 2012. Matlab r2011a , Win 32 bit. Windows 7 64bit. Please provide any additional information below. The attached updated file factorGraphToMrf2.m contains a proposed fix for the issue, which appears to be at line 34:
edgesWithPots = cell2mat(cellfuncell(@(f)f.domain, epots));
whereby a row vector is returned, which is inconsistent with edgeEnds - i.e. a column vector - when compared at line 35.
The proposed fix is after line 32: epots = fg.factors(edgeFacNdx);
to add the following:
if isrowvec(epots) epots = epots'; end
Attachment: factorGraphToMrf2.m mrfToMrf2Issue.m
Original issue: http://code.google.com/p/pmtk3/issues/detail?id=43