@@ -767,7 +767,7 @@ protected override void GetGradientInOneQuery(int query, int threadIndex)
767
767
{
768
768
// calculates the permutation that orders "scores" in descending order, without modifying "scores"
769
769
Array . Copy ( _oneTwoThree , permutation , numDocuments ) ;
770
- #if USE_FASTTREENATIVE2
770
+ #if USE_FASTTREENATIVE
771
771
772
772
PermutationSort ( permutation , scoresToUse , labels , numDocuments , begin ) ;
773
773
// Get how far about baseline our current
@@ -818,24 +818,26 @@ protected override void GetGradientInOneQuery(int query, int threadIndex)
818
818
if ( ! _trainDcg && ( _costFunctionParam == 'c' || _useShiftedNdcg ) )
819
819
{
820
820
PermutationSort ( permutation , scoresToUse , labels , numDocuments , begin ) ;
821
- inverseMaxDcg = 1.0 / DCGCalculator . MaxDCGQuery ( labels , begin , numDocuments , numDocuments , _labelCounts [ query ] ) ;
821
+ inverseMaxDcg = 1.0 / DcgCalculator . MaxDcgQuery ( labels , begin , numDocuments , numDocuments , _labelCounts [ query ] ) ;
822
822
}
823
- C_GetDerivatives ( numDocuments , begin , pPermutation , pLabels ,
823
+ // A constant related to secondary labels, which does not exist in the current codebase.
824
+ const bool secondaryIsolabelExclusive = false ;
825
+ GetDerivatives ( numDocuments , begin , pPermutation , pLabels ,
824
826
pScores , pLambdas , pWeights , pDiscount ,
825
827
inverseMaxDcg , pGainLabels ,
826
- _secondaryMetricShare , _secondaryIsolabelExclusive , secondaryInverseMaxDcg , pSecondaryGains ,
828
+ _secondaryMetricShare , secondaryIsolabelExclusive , secondaryInverseMaxDcg , pSecondaryGains ,
827
829
pSigmoidTable , _minScore , _maxScore , _sigmoidTable . Length , _scoreToSigmoidTableFactor ,
828
830
_costFunctionParam , _distanceWeight2 , numActualResults , & lambdaSum , double . MinValue ,
829
831
_baselineAlphaCurrent , baselineDcgGap ) ;
830
832
831
833
// For computing the "ideal" case of the DCGs.
832
834
if ( _baselineDcg != null )
833
835
{
834
- if ( scoresToUse == _scores )
835
- Array . Copy ( _scores , begin , _scoresCopy , begin , numDocuments ) ;
836
+ if ( scoresToUse == Scores )
837
+ Array . Copy ( Scores , begin , _scoresCopy , begin , numDocuments ) ;
836
838
for ( int i = begin ; i < begin + numDocuments ; ++ i )
837
839
{
838
- _scoresCopy [ i ] += _gradient [ i ] / _weights [ i ] ;
840
+ _scoresCopy [ i ] += Gradient [ i ] / Weights [ i ] ;
839
841
}
840
842
Array . Copy ( _oneTwoThree , permutation , numDocuments ) ;
841
843
PermutationSort ( permutation , _scoresCopy , labels , numDocuments , begin ) ;
0 commit comments