mulan.classifier.neural
Class MMPMaxUpdateRule

java.lang.Object
  extended by mulan.classifier.neural.MMPUpdateRuleBase
      extended by mulan.classifier.neural.MMPMaxUpdateRule
All Implemented Interfaces:
ModelUpdateRule

public class MMPMaxUpdateRule
extends MMPUpdateRuleBase

Implementation of max update rule for MMPLearner. Only two perceptrons will receive updates, the one corresponding to the lowest ranked relevant label and the one corresponding to the highest ranked non-relevant label.

The model is represented as a list of perceptrons (one for each label), each represented by Neuron. Perceptrons are expected to be in the same order as labels in training data set.

Version:
2012.02.27
Author:
Jozef Vilcek
See Also:
MMPUpdateRuleBase

Constructor Summary
MMPMaxUpdateRule(List<Neuron> perceptrons, RankingLossFunction lossMeasure)
          Creates a new instance of MMPMaxUpdateRule.
 
Method Summary
protected  double[] computeUpdateParameters(DataPair example, double[] confidences, double loss)
          Computes update parameters for each perceptron which will be subsequently used for updating the weights.
 
Methods inherited from class mulan.classifier.neural.MMPUpdateRuleBase
process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MMPMaxUpdateRule

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

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

computeUpdateParameters

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

Specified by:
computeUpdateParameters in class MMPUpdateRuleBase
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