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

          craigm Craig Macdonald created issue -
          craigm Craig Macdonald made changes -
          Field Original Value New Value
          Assignee Craig Macdonald [ craigm ] Rodrygo L. T. Santos [ rodrygo ]
          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.
          rodrygo Rodrygo L. T. Santos made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          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
          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.
          craigm Craig Macdonald made changes -
          Project TREC [ 10010 ] Terrier Core [ 10000 ]
          Key TREC-201 TR-141
          Workflow jira [ 10457 ] Terrier Open Source [ 10534 ]
          Affects Version/s 3.0 [ 10030 ]
          Affects Version/s 3.0 [ 10020 ]
          Component/s Core [ 10020 ]
          Fix Version/s 3.1 [ 10040 ]
          Fix Version/s 3.1 [ 10021 ]

            People

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

              Dates

              • Created:
                Updated:
                Resolved: