org.dllearner.algorithms.refinement2
Class ROLComponent2

java.lang.Object
  extended by org.dllearner.core.Component
      extended by org.dllearner.core.LearningAlgorithm
          extended by org.dllearner.algorithms.refinement2.ROLComponent2

public class ROLComponent2
extends LearningAlgorithm

The DL-Learner learning algorithm component for the example based refinement operator approach. It handles all configuration options, creates the corresponding objects and passes them to the actual refinement operator, heuristic, and learning algorithm implementations. Note: The options supported by the ROLearner component and this one are not equal. Options that have been dropped for now: - horizontal expansion factor: The goal of the algorithm will be to (hopefully) be able to learn long and complex concepts more efficiently. A horizontal expansion factor has its benefits, but limits the length of concepts learnable in reasonable time to about 15 with its default value of 0.6 and a small sized background knowledge base. We hope to get more fine-grained control of whether it makes sense to extend a node with more sophisticated heuristics. Dropping the horizontal expansion factor means that the completeness of the algorithm depends on the heuristic.

Author:
Jens Lehmann

Field Summary
 
Fields inherited from class org.dllearner.core.LearningAlgorithm
MAX_NR_OF_RESULTS
 
Constructor Summary
ROLComponent2(PosNegLP learningProblem, ReasonerComponent reasoningService)
           
ROLComponent2(PosOnlyLP learningProblem, ReasonerComponent reasoningService)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
static Collection<ConfigOption<?>> createConfigOptions()
           
 ROLComponent2Configurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script ConfigJavaGenerator.
 Description getCurrentlyBestDescription()
           
 List<Description> getCurrentlyBestDescriptions()
           
 EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription()
          Returns the best descriptions obtained so far.
 SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions()
          Returns a sorted set of the best descriptions found so far.
static String getName()
           
 ScorePosNeg getSolutionScore()
           
 ExampleBasedNode getStartNode()
           
static String getUsage()
           
 void init()
          Method to be called after the component has been configured.
 boolean isRunning()
          Returns whether the learning algorithm is running.
 void pause()
          Pauses the algorithm (not all algorithms need to implement this operation).
 void resume()
          Resumes the algorithm (not all algorithms need to implement this operation).
 void start()
          Starts the algorithm.
 void stop()
          Stops the algorithm gracefully.
static Collection<Class<? extends LearningProblem>> supportedLearningProblems()
           
 
Methods inherited from class org.dllearner.core.LearningAlgorithm
changeLearningProblem, changeReasonerComponent, getCurrentlyBestDescriptions, getCurrentlyBestDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestEvaluatedDescriptions, getCurrentlyBestEvaluatedDescriptions
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ROLComponent2

public ROLComponent2(PosNegLP learningProblem,
                     ReasonerComponent reasoningService)

ROLComponent2

public ROLComponent2(PosOnlyLP learningProblem,
                     ReasonerComponent reasoningService)
Method Detail

getConfigurator

public ROLComponent2Configurator getConfigurator()
Description copied from class: Component
For each component, a configurator class is generated in package org.dllearner.core.configurators using the script ConfigJavaGenerator. The configurator provides set and get methods for the configuration options of a component.

Specified by:
getConfigurator in class Component
Returns:
An object allowing to configure this component.

supportedLearningProblems

public static Collection<Class<? extends LearningProblem>> supportedLearningProblems()

createConfigOptions

public static Collection<ConfigOption<?>> createConfigOptions()

applyConfigEntry

public <T> void applyConfigEntry(ConfigEntry<T> entry)
                      throws InvalidConfigOptionValueException
Description copied from class: Component
Applies a configuration option to this component. Implementations of components should use option and value of the config entry to perform an action (usually setting an internal variable to an appropriate value). Since the availability of configurators, it is optional for components to implement this method. Instead of using this method to take an action based on a configuration value, components can also use the getters defined in the components configurator. Important note: Never call this method directly. All calls are done via the ComponentManager.

Type Parameters:
T - Type of the config entry (Integer, String etc.).
Parameters:
entry - A configuration entry.
Throws:
InvalidConfigOptionValueException - This exception is thrown if the value of the config entry is not valid. For instance, a config option may only accept values, which are within intervals 0.1 to 0.3 or 0.5 to 0.8. If the value is outside of those intervals, an exception is thrown. Note that many of the common cases are already caught in the constructor of ConfigEntry (for instance for a DoubleConfigOption you can specify an interval for the value). This means that, as a component developer, you often do not need to implement further validity checks.
See Also:
Component.getConfigurator()

init

public void init()
          throws ComponentInitException
Description copied from class: Component
Method to be called after the component has been configured. Implementation of components can overwrite this method to perform setup and initialisation tasks for this component.

Specified by:
init in class Component
Throws:
ComponentInitException - This exception is thrown if any exceptions occur within the initialisation process of this component. As component developer, you are encouraged to rethrow occuring exception as ComponentInitException and giving an error message as well as the actualy exception by using the constructor ComponentInitException.ComponentInitException(String, Throwable).

getName

public static String getName()

getUsage

public static String getUsage()

start

public void start()
Description copied from class: LearningAlgorithm
Starts the algorithm. It runs until paused, stopped, or a termination criterion has been reached.

Specified by:
start in class LearningAlgorithm

getSolutionScore

public ScorePosNeg getSolutionScore()

getCurrentlyBestDescription

public Description getCurrentlyBestDescription()
Specified by:
getCurrentlyBestDescription in class LearningAlgorithm
Returns:
The best class description found by the learning algorithm so far.
See Also:
LearningAlgorithm.getCurrentlyBestEvaluatedDescription()

getCurrentlyBestDescriptions

public List<Description> getCurrentlyBestDescriptions()
Overrides:
getCurrentlyBestDescriptions in class LearningAlgorithm
Returns:
The best class descriptions found by the learning algorithm so far.
See Also:
LearningAlgorithm.getCurrentlyBestEvaluatedDescriptions()

getCurrentlyBestEvaluatedDescription

public EvaluatedDescriptionPosNeg getCurrentlyBestEvaluatedDescription()
Description copied from class: LearningAlgorithm
Returns the best descriptions obtained so far.

Specified by:
getCurrentlyBestEvaluatedDescription in class LearningAlgorithm
Returns:
Best class description found so far.

getCurrentlyBestEvaluatedDescriptions

public SortedSet<EvaluatedDescriptionPosNeg> getCurrentlyBestEvaluatedDescriptions()
Description copied from class: LearningAlgorithm
Returns a sorted set of the best descriptions found so far. We assume that they are ordered such that the best ones come in first.

Overrides:
getCurrentlyBestEvaluatedDescriptions in class LearningAlgorithm
Returns:
Best class descriptions found so far.

stop

public void stop()
Stops the algorithm gracefully. A stopped algorithm cannot be resumed anymore. Use this method for cleanup and freeing memory.

Specified by:
stop in class LearningAlgorithm

getStartNode

public ExampleBasedNode getStartNode()

pause

public void pause()
Pauses the algorithm (not all algorithms need to implement this operation).

Overrides:
pause in class LearningAlgorithm

resume

public void resume()
Resumes the algorithm (not all algorithms need to implement this operation). You can use this method to continue an algorithm run even after a termination criterion has been reached. It will run until paused, stopped, or terminated again.

Overrides:
resume in class LearningAlgorithm

isRunning

public boolean isRunning()
Returns whether the learning algorithm is running. Implementation should use a boolean status variable in their implementations of the start and resume methods.

Specified by:
isRunning in class LearningAlgorithm
Returns:
True if the algorithm is running, false otherwise.


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2008 Jens Lehmann