NORSYS SOFTWARE © 2012 | NETICA API | C   VERSION   5.04  |
void FadeCPTable_bn ( | node_bn* node, double degree ) |
Smoothes the conditional probabilities (CPT) of node to indicate greater uncertainty, which accounts for the idea that the world may have changed a little since they were last learned.
degree must be between 0 and 1, with 0 having no effect and 1 creating uniform distributions with no experience. Calling FadeCPTable_bn once with degree = 1-d, and again with degree = 1-f, is equivalent to a single call with degree = 1-df.
The global variable BaseExperience_bn is used in the calculation as shown below. It's value should be the same as it was when the learning from cases was done (if it was). It must be greater than 0, and the most common value for it is 1 (1/2 is also commonly used). You will normally set it to one of these choices, depending on your philosophy, and leave it that way permanently.
Each of the probabilities in the node's conditional probability table is modified as follows (where prob and exper are the old values of probability and experience, and prob' and exper' are the new values):
prob' = normalize (prob * exper - (prob * exper - BaseExperience_bn) * degree)
prob' = normalize (prob * exper * (1 - degree) + degree * BaseExperience_bn)
exper' is obtained as the normalization factor from above. So:
prob' * exper' = prob * exper * (1 - degree) + degree * BaseExperience_bn
When learning in a changing environment, you would normally call FadeCPTable_bn every once in a while, so that what has been recently learned is more strongly weighted than what was learned long ago. If an occurrence time for each case is known, and the cases are learned sequentially through time, then the amount of fading to be done is:
degree = 1 - rDt where Dt is the amount of time since the last fading was done, and r is a number less than, but close to, 1 and depends on the units of time and how quickly the environment is changing. See the example below.
Version:
See also:
ReviseCPTsByFindings_bn | Is passed a 'degree', which also can be used to weight the impact of learning a case | |
GetNodeProbs_bn | Read out the faded probabilities table | |
GetNodeExperience_bn | Read out the faded experience table |
Example:
Example 2:The following function is available in NeticaEx.c:// The following does the same fading for a list of nodes: // void FadeCPTsForNodes (const nodelist_bn* nodes, double degree){ int nn, num_nodes = LengthNodeList_bn (nodes); for (nn = 0; nn < num_nodes; ++nn) FadeCPTable_bn (NthNode_bn (nodes, nn), degree); }
// The following bit of code may be executed in a loop which is // traversed as the cases are learned, in order to do the // required fading: // time - the occurrence time of the last case learned // lasttime - a number initialized to the time of the 1st case // mindelay - a number controlling how often fading is done // rate - a number determining how much fading is done // net - the net being learned if (time - lasttime >= mindelay){ double degree = 1 - pow (rate, time - lasttime); FadeCPTsForNodes (GetNetNodes_bn (net), degree); lasttime = time; }