API - DBN

The engine.
Post Reply
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

API - DBN

Post by sez »

We recently found out that the probabilities generated by API (API - DBN we received in June 2009) DID NOT match the probabilities generated by GeNie.


  • net.ClearAllEvidence();
    net.SliceCount = myTable.Rows.Count;

    foreach (DataRow myRow in myTable.Rows)
    • setEvidenceProcess(myRow, actionNode, net);


    public void setEvidenceProcess(DataRow row, AppNode actionNode, Network net)
    {
    • ...
      foreach (DictionaryEntry de in slStateLabels)
      {
      ...
      • {
        • net.SetTemporalEvidence(nHandler, IDtemp, outcomeIndex); //(int nodeHandler, int slice, int outComeIndex)
        }
      }
    }

    ...
    net.UpdateBeliefs();
    ...

    int nHandle = node.getNodeID();
    ...
    double[] probArray = net.GetNodeValue(nHandle);

We did the same thing in GeNie, and compared node by node and found the probabilities generated are different.

Could you tell us why and do you have new API for DBN?
sez
Posts: 11
Joined: Fri Jun 05, 2009 6:41 pm

Post by sez »

Hi,

Your code apparently uses 1-based temporal indices (the loop goes from 1 to
6 with 6 slices), while Network.SetTemporalEvidence requires the temporal index to be zero-based.

The internal C++ implementation of SetTemporalEvidence simply stores the temporal index and outcome without validation checks, so there's no error code return in C++ and no exception in your .Net code.

Regards,
Tomasz Sowinski
Thank you for your reply. The problem solved. :D [/quote]
Post Reply