Uploaded image for project: 'Terrier Core'
  1. Terrier Core
  2. TR-141

GammaFunction in core is not good enough for proximity

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.5
    • Component/s: None
    • Labels:
      None

      Description

      After TREC-131, we are using the WikipediaGammaFunction. This is insufficient (IIRC, it doesnt handle non-integer input). We need to find a better one before releasing 3.1.

        Attachments

          Activity

          Hide
          craigm Craig Macdonald added a comment -

          I verified that DFR proximity now behaves properly. Well done Rodrygo for reworking the Wikipedia implementation.

          Show
          craigm Craig Macdonald added a comment - I verified that DFR proximity now behaves properly. Well done Rodrygo for reworking the Wikipedia implementation.
          Hide
          craigm Craig Macdonald added a comment -

          Here is a class I used while debugging the Gamma Function

              static class DebuggingGammaFunction extends GammaFunction
              {
                  GammaFunction parent;
                  DebuggingGammaFunction(GammaFunction p)
                  {
                      parent = p;
                  }
                  
                  @Override
                  public double compute(double number) {
                      double rtr = parent.compute(number);
                      System.err.println("compute("+number +")="+rtr);
                      return rtr;
                  }
          
                  @Override
                  public double compute_log(double number) {
                      double rtr = parent.compute_log(number);
                      System.err.println("compute_log("+number +")="+rtr);
                      return rtr;
                  }
                  
              }
          
          Show
          craigm Craig Macdonald added a comment - Here is a class I used while debugging the Gamma Function static class DebuggingGammaFunction extends GammaFunction { GammaFunction parent; DebuggingGammaFunction(GammaFunction p) { parent = p; } @Override public double compute( double number) { double rtr = parent.compute(number); System .err.println( "compute(" +number + ")=" +rtr); return rtr; } @Override public double compute_log( double number) { double rtr = parent.compute_log(number); System .err.println( "compute_log(" +number + ")=" +rtr); return rtr; } }
          Hide
          rodrygo Rodrygo L. T. Santos added a comment -

          Current implementation overflows for large input values. I have fixed it by replacing raw computations with log-based computations. Test cases for large input values have been added. The documentation was updated to reflect that all GammaFunction implementations assume a positive input value, so as to avoid the issue of logarithms of negative values.

          Show
          rodrygo Rodrygo L. T. Santos added a comment - Current implementation overflows for large input values. I have fixed it by replacing raw computations with log-based computations. Test cases for large input values have been added. The documentation was updated to reflect that all GammaFunction implementations assume a positive input value, so as to avoid the issue of logarithms of negative values.

            People

            • Assignee:
              rodrygo Rodrygo L. T. Santos
              Reporter:
              craigm Craig Macdonald
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: