I have put together a belief network with about 2 dozen discrete nodes. 22 of these nodes are Boolean based, with 2 target nodes.
I intend of learning parameter weights by using DSL_em, I have all the data but it is taking for ever, to train the model. To be a bit more specific one record takes like 3.5 minutes. I would like to train this model with 700,000 records out of a db, which is not possible due to speed of learning. I am running the latest build of VC 9 SP1 on win 2003 server with Quad core and 8Gb of RAM.
I am unsure what i am doing wrong. what follows is brief description of my setup, hopefully someone could help me find my blunder.
1) creatnetwork SetDefaultBNAlgorithm to DSL_ALG_BN_EPISSAMPLING and
SetNumberOfSamples to 493476
2) create DSL_em with defaults
3) Add all nodes with type DSL_CPT for the boolean based variables i
setup outcomes using a DSL_stringArray "false" and "true" also i store the indexes of the string in the array so i can specify the indexes for learning. I was doubtful about this is this correct way to do it. As in some cases i might have more discrete states than just boolean. I set target on 3 nodes and all my 3 target nodes are normally arced with all the rest of evidence nodes as parents(20 arcs for each target).
4)I set up DSL_em SetRelevance to true and activaterelevance on the network.
5) In order to train i do the following
Code: Select all
DSL_dataset ds;
std::vector<DSL_datasetMatch> matchings;
std::string err_msg;
//setup all the vars by calling ds.AddIntVar(node->Info().Header().GetId(), DSL_MISSING_INT);
ds.MatchNetwork(*m_network, matchings, err_msg)
while (More_records)
{
ds.AddEmptyRecord();
//for each variable i call ds.SetInt with parameters set as appropriate node handle, record no, index of the corresponding state from DSL_stringArray from step 3
}
then i call learn.