mulan.classifier.neural
Class MMPUpdateRuleBase

java.lang.Object
  extended by mulan.classifier.neural.MMPUpdateRuleBase
All Implemented Interfaces:
ModelUpdateRule
Direct Known Subclasses:
MMPMaxUpdateRule, MMPRandomizedUpdateRule, MMPUniformUpdateRule

public abstract class MMPUpdateRuleBase
extends Object
implements ModelUpdateRule

The base class of update rules for MMPLearner. The base class implements the ModelUpdateRule interface and provides a common logic shared among update rules for MMPLearner. More information on uprate rules logic can be found in paper referenced by MMPLearner.

Version:
2012.02.27
Author:
Jozef Vilcek
See Also:
MMPLearner

Constructor Summary
MMPUpdateRuleBase(List<Neuron> perceptrons, RankingLossFunction loss)
          Creates a new instance of MMPUpdateRuleBase.
 
Method Summary
protected abstract  double[] computeUpdateParameters(DataPair example, double[] confidences, double loss)
          Computes update parameters for each perceptron which will be subsequently used for updating the weights.
 double process(DataPair example, Map<String,Object> params)
          Process the training example and performs a model update when suitable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMPUpdateRuleBase

public MMPUpdateRuleBase(List<Neuron> perceptrons,
                         RankingLossFunction loss)
Creates a new instance of MMPUpdateRuleBase.

Parameters:
perceptrons - the list of perceptrons, representing the model, which will receive updates.
loss - the lossFunction measure used to decide when the model should be updated by the rule
Method Detail

process

public final double process(DataPair example,
                            Map<String,Object> params)
Description copied from interface: ModelUpdateRule
Process the training example and performs a model update when suitable. The decision when to perform model update is carried by the update rule (e.g. when the model response is not within an acceptable boundaries from the true output for given example).

Specified by:
process in interface ModelUpdateRule
Parameters:
example - the input example
params - the additional parameters for an update.
Returns:
the error measure of the model response for given input pattern and specified true output.

computeUpdateParameters

protected abstract double[] computeUpdateParameters(DataPair example,
                                                    double[] confidences,
                                                    double loss)
Computes update parameters for each perceptron which will be subsequently used for updating the weights. The function is called internally from process(DataPair, Map) function, when update of model for given input example is needed.

Parameters:
example - the input example
confidences - the confidences outputed by the model the input example
loss - the lossFunction measure of the model for given input example
Returns:
the parameters for updating preceptrons