Class RankNet

  • Direct Known Subclasses:
    LambdaRank, ListNet

    public class RankNet
    extends Ranker
    Author:
    vdang This class implements RankNet. C.J.C. Burges, T. Shaked, E. Renshaw, A. Lazier, M. Deeds, N. Hamilton and G. Hullender. Learning to rank using gradient descent. In Proc. of ICML, pages 89-96, 2005.
    • Field Detail

      • nIteration

        public static int nIteration
      • nHiddenLayer

        public static int nHiddenLayer
      • nHiddenNodePerLayer

        public static int nHiddenNodePerLayer
      • learningRate

        public static double learningRate
      • layers

        protected java.util.List<Layer> layers
      • inputLayer

        protected Layer inputLayer
      • outputLayer

        protected Layer outputLayer
      • bestModelOnValidation

        protected java.util.List<java.util.List<java.lang.Double>> bestModelOnValidation
      • totalPairs

        protected int totalPairs
      • misorderedPairs

        protected int misorderedPairs
      • error

        protected double error
      • lastError

        protected double lastError
      • straightLoss

        protected int straightLoss
    • Constructor Detail

      • RankNet

        public RankNet()
      • RankNet

        public RankNet​(java.util.List<RankList> samples,
                       int[] features,
                       MetricScorer scorer)
    • Method Detail

      • setInputOutput

        protected void setInputOutput​(int nInput,
                                      int nOutput)
        Setting up the Neural Network
      • setInputOutput

        protected void setInputOutput​(int nInput,
                                      int nOutput,
                                      int nType)
      • addHiddenLayer

        protected void addHiddenLayer​(int size)
      • wire

        protected void wire()
      • connect

        protected void connect​(int sourceLayer,
                               int sourceNeuron,
                               int targetLayer,
                               int targetNeuron)
      • addInput

        protected void addInput​(DataPoint p)
        Auxiliary functions for pair-wise preference network learning.
      • propagate

        protected void propagate​(int i)
      • batchFeedForward

        protected int[][] batchFeedForward​(RankList rl)
      • batchBackPropagate

        protected void batchBackPropagate​(int[][] pairMap,
                                          float[][] pairWeight)
      • clearNeuronOutputs

        protected void clearNeuronOutputs()
      • computePairWeight

        protected float[][] computePairWeight​(int[][] pairMap,
                                              RankList rl)
      • saveBestModelOnValidation

        protected void saveBestModelOnValidation()
        Model validation
      • restoreBestModelOnValidation

        protected void restoreBestModelOnValidation()
      • crossEntropy

        protected double crossEntropy​(double o1,
                                      double o2,
                                      double targetValue)
      • estimateLoss

        protected void estimateLoss()
      • init

        public void init()
        Main public functions
        Specified by:
        init in class Ranker
      • learn

        public void learn()
        Specified by:
        learn in class Ranker
      • toString

        public java.lang.String toString()
        Specified by:
        toString in class Ranker
      • model

        public java.lang.String model()
        Specified by:
        model in class Ranker
      • loadFromString

        public void loadFromString​(java.lang.String fullText)
        Specified by:
        loadFromString in class Ranker
      • name

        public java.lang.String name()
        Specified by:
        name in class Ranker
      • printNetworkConfig

        protected void printNetworkConfig()
        FOR DEBUGGING PURPOSE ONLY
      • printWeightVector

        protected void printWeightVector()