From: <jen...@us...> - 2008-09-16 11:17:35
|
Revision: 1221 http://dl-learner.svn.sourceforge.net/dl-learner/?rev=1221&view=rev Author: jenslehmann Date: 2008-09-16 18:17:33 +0000 (Tue, 16 Sep 2008) Log Message: ----------- added new option forceRefinementLengthIncrease to ROL based learner, which enforces that nodes are expanded until all successors have higher length (i.e. the subsumption hierarchy is traversed until no further children exists or the concept is too weak) Modified Paths: -------------- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-09-16 10:53:25 UTC (rev 1220) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLComponent.java 2008-09-16 18:17:33 UTC (rev 1221) @@ -128,6 +128,7 @@ // refactor this private static int maxPosOnlyExpansionDefault = 4; private int maxPosOnlyExpansion = maxPosOnlyExpansionDefault; + private boolean forceRefinementLengthIncrease = false; //extended Options //in seconds private int maxExecutionTimeInSeconds = CommonConfigOptions.maxExecutionTimeInSecondsDefault; @@ -204,6 +205,7 @@ noisePercentage.setUpperLimit(100); options.add(noisePercentage); options.add(new StringConfigOption("startClass", "the named class which should be used to start the algorithm (GUI: needs a widget for selecting a class)")); + options.add(new BooleanConfigOption("forceRefinementLengthIncrease", "specifies whether nodes should be expanded until only longer refinements are reached")); return options; } @@ -274,6 +276,8 @@ guaranteeXgoodDescriptions = (Integer) entry.getValue(); } else if(name.equals("logLevel")) { logLevel = ((String)entry.getValue()).toUpperCase(); + } else if(name.equals("forceRefinementLengthIncrease")) { + forceRefinementLengthIncrease = (Boolean) entry.getValue(); } } @@ -385,8 +389,9 @@ maxPosOnlyExpansion, maxExecutionTimeInSeconds, minExecutionTimeInSeconds, - guaranteeXgoodDescriptions - ); + guaranteeXgoodDescriptions, + forceRefinementLengthIncrease + ); // note: used concepts and roles do not need to be passed // as argument, because it is sufficient to prepare the // concept and role hierarchy accordingly Modified: trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java =================================================================== --- trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-09-16 10:53:25 UTC (rev 1220) +++ trunk/src/dl-learner/org/dllearner/algorithms/refexamples/ExampleBasedROLearner.java 2008-09-16 18:17:33 UTC (rev 1221) @@ -131,6 +131,15 @@ // (this is called irregularly e.g. every 100 seconds) private boolean useTreeTraversal = false; + // if this variable is set to true, then the refinement operator + // is applied until all concept of equal length have been found + // e.g. TOP -> A1 -> A2 -> A3 is found in one loop; the disadvantage + // are potentially more method calls, but the advantage is that + // the algorithm is better in locating relevant concept in the + // subsumption hierarchy (otherwise, if the most general concept + // is not promising, it may never get expanded) + private boolean forceRefinementLengthIncrease; + // candidate reduction: using this mechanism we can simulate // the divide&conquer approach in many ILP programs using a // clause by clause search; after a period of time the candidate @@ -233,7 +242,7 @@ boolean useTooWeakList, boolean useOverlyGeneralList, boolean useShortConceptConstruction, boolean usePropernessChecks, int maxPosOnlyExpansion, int maxExecutionTimeInSeconds, int minExecutionTimeInSeconds, - int guaranteeXgoodDescriptions) { + int guaranteeXgoodDescriptions, boolean forceRefinementLengthIncrease) { if (learningProblem instanceof PosNegLP) { PosNegLP lp = (PosNegLP) learningProblem; @@ -278,6 +287,7 @@ this.maxExecutionTimeInSeconds = maxExecutionTimeInSeconds; this.minExecutionTimeInSeconds = minExecutionTimeInSeconds; this.guaranteeXgoodDescriptions = guaranteeXgoodDescriptions; + this.forceRefinementLengthIncrease = forceRefinementLengthIncrease; // logger.setLevel(Level.DEBUG); } @@ -835,6 +845,16 @@ // System.out.println(newNode.getConcept() + " " + quality); node.addChild(newNode); + + // it is often useful to continue expanding until a longer node is + // reached (to replace atomic concepts with more specific ones) + if(forceRefinementLengthIncrease) { + // extend node again if its concept has the same length + if(node.getConcept().getLength() == newNode.getConcept().getLength()) { + extendNodeProper(newNode, refinement, maxLength, recDepth + 1); + } + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |