|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.duke.cs.banjo.learner.components.Evaluator
edu.duke.cs.banjo.learner.components.EvaluatorBDe
Computes the BDe score of a network. This score is simply the sum of the scores of the individual nodes in the network, which lends itself to performance-enhancements using several schemes of caching the node scores.
Details:
Change History:
Created on Jul 11, 2006
9/6/2005 (v1.0.3) hjs Correct defect in constructor, by making use of caching arrays conditional.
10/28/2005 (v2.0) hjs Replace maxValueCount dependency on constant with observed value from data.
hjs (v1.0.6) 12/7/2005 Add condition for checking varCount versus the maxParentCount (will be handled via validation from v2.0.x forward).
hjs (v2.0) Add inner classes for selecting between new compact observations
and original ("legacy") observations (which used multi-dim. arrays).
The fast-cache implementations have been improved to be more sensitive
to memory use (applies for minMarkovLag>0).
The use of the legacy observations is only provided for illustrative
purpose. The corresponding code will be deprecated in future versions
of Banjo.
hjs (v2.1) Modifications for execution as a multi-threaded application:
- Observations are now loaded upfront before entering the searcher
- fastCache is shared between threads (regular cache is not)
- logGamma-preCompute cache is shared between threads
Nested Class Summary | |
protected class |
EvaluatorBDe.CompactObservationsSelector
|
protected class |
EvaluatorBDe.LegacyObservationsSelector
|
private class |
EvaluatorBDe.LogGammaArray
|
private class |
EvaluatorBDe.LogGammaComputer
|
private class |
EvaluatorBDe.LogGammaProvider
|
Nested classes inherited from class edu.duke.cs.banjo.learner.components.Evaluator |
Evaluator.ObservationsSelector |
Field Summary | |
protected double |
alpha
|
protected double |
checkBestNetworkScore
|
protected int |
dimLags
|
protected int |
dimObservations
|
protected int |
dimVariables
|
protected static double[] |
fastNodeScoreCacheFor0parents
|
protected static double[][] |
fastNodeScoreCacheFor1parent
|
protected static double[][][] |
fastNodeScoreCacheFor2parents
|
protected EvaluatorBDe.LogGammaProvider |
logGammaSelector
|
protected static double[][] |
logGammaValue
|
protected int |
maxValueCount
|
protected int[] |
N_ij
|
protected int[] |
N_ijk
|
protected int |
observationCount
|
protected Evaluator.ObservationsSelector |
observationsSelector
|
protected int |
offsetLags
|
protected int |
offsetObservations
|
protected int |
offsetVariables
|
protected double |
scoreDiff
|
protected double |
unreachableBDeScore
|
Fields inherited from class edu.duke.cs.banjo.learner.components.Evaluator |
b, cachedCurrentNodePreviousScore, cachedNetworkPreviousScore, cachedNetworkScore, cachedNodeScores, cachedParentNodePreviousScore, collisionsInCacheTracker, computedScoreTracker, crossCheckCachedScoreTracker, currentNodeScoreHashItem, fastCacheLevel, feedbackBuffer, fetchedCachedScoreTracker, highestParentCountEncountered, maxMarkovLag, minMarkovLag, nodeScoreHashMap, placedInCacheScoreTracker, processData, retrievedNodeScoreHashItem, useBasicCache, useCache, varCount |
Constructor Summary | |
EvaluatorBDe(BayesNetManagerI _initialBayesNet,
Settings _processData)
|
Method Summary | |
void |
adjustNodeScoresForUndo(BayesNetChangeI suggestedBayesNetChange)
Adjusts the various internal score containers when a bayesNetChange is not permanently kept. |
void |
cleanupOnException()
|
double |
computeInitialNetworkScore(BayesNetManagerI currentBayesNetManager)
|
private double |
computeNodeScore(int nodeID,
int[][] parentIDlist)
|
private int[][] |
order2Parents(int[][] parentListWith2Nodes)
|
void |
testNodeScores(int currentNodeID,
int[][] parentIDlist,
double nodeScore)
|
double |
updateNetworkScore(BayesNetManagerI currentBayesNetManager,
BayesNetChangeI currentBayesNetChange)
Computes the score of the network described by the bayesNetManager, based on the proposed bayesNetChange. |
private boolean |
validateRequiredData()
Validates the settings values required for loading the BDe evaluator. |
Methods inherited from class edu.duke.cs.banjo.learner.components.Evaluator |
loggamma, logGamma, provideCollectedStatistics, updateProcessData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected final double alpha
protected final int observationCount
protected final int maxValueCount
protected int[] N_ij
protected int[] N_ijk
protected final double scoreDiff
protected final double unreachableBDeScore
protected double checkBestNetworkScore
protected EvaluatorBDe.LogGammaProvider logGammaSelector
protected Evaluator.ObservationsSelector observationsSelector
protected final int dimObservations
protected final int dimVariables
protected final int dimLags
protected final int offsetObservations
protected final int offsetVariables
protected final int offsetLags
protected static double[] fastNodeScoreCacheFor0parents
protected static double[][] fastNodeScoreCacheFor1parent
protected static double[][][] fastNodeScoreCacheFor2parents
protected static double[][] logGammaValue
Constructor Detail |
public EvaluatorBDe(BayesNetManagerI _initialBayesNet, Settings _processData) throws java.lang.Exception
Method Detail |
private boolean validateRequiredData() throws java.lang.Exception
java.lang.Exception
public double computeInitialNetworkScore(BayesNetManagerI currentBayesNetManager) throws java.lang.Exception
computeInitialNetworkScore
in interface EvaluatorI
computeInitialNetworkScore
in class Evaluator
java.lang.Exception
public double updateNetworkScore(BayesNetManagerI currentBayesNetManager, BayesNetChangeI currentBayesNetChange) throws java.lang.Exception
EvaluatorI
updateNetworkScore
in interface EvaluatorI
updateNetworkScore
in class Evaluator
java.lang.Exception
private double computeNodeScore(int nodeID, int[][] parentIDlist) throws java.lang.Exception
java.lang.Exception
public void adjustNodeScoresForUndo(BayesNetChangeI suggestedBayesNetChange) throws java.lang.Exception
EvaluatorI
adjustNodeScoresForUndo
in interface EvaluatorI
adjustNodeScoresForUndo
in class Evaluator
java.lang.Exception
private int[][] order2Parents(int[][] parentListWith2Nodes)
public void testNodeScores(int currentNodeID, int[][] parentIDlist, double nodeScore) throws java.lang.Exception
java.lang.Exception
public void cleanupOnException() throws java.lang.Exception
cleanupOnException
in class Evaluator
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |