Hi!
For some evidence configurations in my DBN I get a "corrupted size vs. prev_size" error when executing "UpdateBeliefs()" in c++. As it only occurs for some evidence configurations I thought it could be due to an impossible evidence configuration. To test this out I tried to insert the same evidence in Genie, which evaluated the network without any problems, so that's maybe not the problem? I have tried to change to an approximate solver, but that had no effect.
I know this is way too little information to know what my problem is, but as I'm having trouble figuring out which information that is relevant, maybe you have some ideas on the causes of this error?
Best regards
Sverre
"corrupted size vs. prev_size" error when evaluating DBN in c++
Re: "corrupted size vs. prev_size" error when evaluating DBN in c++
It seems that the error was caused by giving a (temporal) node virtual evidence with 0% probability for each outcome. The SetTemporalEvidence() function returned 0 indicating no error, and the error first occurred when trying to evaluate the network. I don't know if this is the case for non-temporal nodes as well, using the SetVirtualEvidence() function.
I wonder why that resulted in a "corrupted size vs. prev_size" error 🤔 Would it be possible to give out a more informative error message when attempting to set virtual evidence not summing to 1? I understand if this is not top priority :)
Another random question, how precisely does the sum of virtual evidence have to be equal to 1? Is it robust against floating-point errors?
I wonder why that resulted in a "corrupted size vs. prev_size" error 🤔 Would it be possible to give out a more informative error message when attempting to set virtual evidence not summing to 1? I understand if this is not top priority :)
Another random question, how precisely does the sum of virtual evidence have to be equal to 1? Is it robust against floating-point errors?
-
- Site Admin
- Posts: 1422
- Joined: Mon Nov 26, 2007 5:51 pm
Re: "corrupted size vs. prev_size" error when evaluating DBN in c++
The values are normalized, so it should be robust. However, the code is not checking against all zeros (or agains negative values); we'll add this test.Another random question, how precisely does the sum of virtual evidence have to be equal to 1? Is it robust against floating-point errors?
I searched for this string in the SMILE soruce code and was unable to find it. Was it an assert, or some other type of message?I wonder why that resulted in a "corrupted size vs. prev_size" error
Re: "corrupted size vs. prev_size" error when evaluating DBN in c++
When googlig this error the only thing I found was this answer in a stackoverflow question:
I suspected that the values were normalized and that it might be a problem if all values were zero, to test it I added a small value to one of the virtual values, but the error persisted. But it might be that I did something else wrong aswell 🤔
Thanks for adding a test against all zero values :)
I don't think it was an assert message.A practical cause to "corrupted size vs. prev_size" is quite simple - memory chunk control structure fields in the adjacent following chunk are being overwritten due to out-of-bounds access by the code. if you allocate x bytes for pointer p but wind up writing beyond x in regards to the same pointer, you might get this error, indicating the current memory allocation (chunk) size is not the same as what's found in the next chunk control structure (due to it being overwritten).
I suspected that the values were normalized and that it might be a problem if all values were zero, to test it I added a small value to one of the virtual values, but the error persisted. But it might be that I did something else wrong aswell 🤔
Thanks for adding a test against all zero values :)