@@ -35,8 +35,7 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalF
3535 const FloatCalc regLambda,
3636 const FloatCalc deltaStepMax,
3737 BinBase* const aAuxiliaryBinsBase,
38- BinBase* const aBinsBase
39- ) {
38+ BinBase* const aBinsBase) {
4039 auto * const aAuxiliaryBins =
4140 aAuxiliaryBinsBase
4241 ->Specialize <FloatMain, UIntMain, true , true , bHessian, GetArrayScores (cCompilerScores)>();
@@ -46,7 +45,6 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalF
4645 const size_t cScores = GET_COUNT_SCORES (cCompilerScores, pInteractionCore->GetCountScores ());
4746 const size_t cBytesPerBin = GetBinSize<FloatMain, UIntMain>(true , true , bHessian, cScores);
4847
49-
5048 Bin<FloatMain, UIntMain, true , true , bHessian, GetArrayScores (cCompilerScores)> totalBin;
5149 static constexpr bool bUseStackMemory = k_dynamicScores != cCompilerScores;
5250 auto * const aTotalGradPair = bUseStackMemory ? totalBin.GetGradientPairs () : aAuxiliaryBins->GetGradientPairs ();
@@ -103,28 +101,13 @@ template<bool bHessian, size_t cPossibleScores> class PartitionMultiDimensionalF
103101 const FloatCalc regLambda,
104102 const FloatCalc deltaStepMax,
105103 BinBase* aAuxiliaryBinsBase,
106- BinBase* const aBinsBase
107- ) {
104+ BinBase* const aBinsBase) {
108105 if (cPossibleScores == pInteractionCore->GetCountScores ()) {
109- return PartitionMultiDimensionalFullInternal<bHessian, cPossibleScores>::Func (pInteractionCore,
110- cTensorBins,
111- flags,
112- regAlpha,
113- regLambda,
114- deltaStepMax,
115- aAuxiliaryBinsBase,
116- aBinsBase
117- );
106+ return PartitionMultiDimensionalFullInternal<bHessian, cPossibleScores>::Func (
107+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
118108 } else {
119- return PartitionMultiDimensionalFullTarget<bHessian, cPossibleScores + 1 >::Func (pInteractionCore,
120- cTensorBins,
121- flags,
122- regAlpha,
123- regLambda,
124- deltaStepMax,
125- aAuxiliaryBinsBase,
126- aBinsBase
127- );
109+ return PartitionMultiDimensionalFullTarget<bHessian, cPossibleScores + 1 >::Func (
110+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
128111 }
129112 }
130113};
@@ -140,17 +123,9 @@ template<bool bHessian> class PartitionMultiDimensionalFullTarget<bHessian, k_cC
140123 const FloatCalc regLambda,
141124 const FloatCalc deltaStepMax,
142125 BinBase* aAuxiliaryBinsBase,
143- BinBase* const aBinsBase
144- ) {
145- return PartitionMultiDimensionalFullInternal<bHessian, k_dynamicScores>::Func (pInteractionCore,
146- cTensorBins,
147- flags,
148- regAlpha,
149- regLambda,
150- deltaStepMax,
151- aAuxiliaryBinsBase,
152- aBinsBase
153- );
126+ BinBase* const aBinsBase) {
127+ return PartitionMultiDimensionalFullInternal<bHessian, k_dynamicScores>::Func (
128+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
154129 }
155130};
156131
@@ -161,56 +136,27 @@ extern double PartitionMultiDimensionalFull(InteractionCore* const pInteractionC
161136 const FloatCalc regLambda,
162137 const FloatCalc deltaStepMax,
163138 BinBase* aAuxiliaryBinsBase,
164- BinBase* const aBinsBase
165- ) {
139+ BinBase* const aBinsBase) {
166140 const size_t cRuntimeScores = pInteractionCore->GetCountScores ();
167141
168142 EBM_ASSERT (1 <= cRuntimeScores);
169143 if (pInteractionCore->IsHessian ()) {
170144 if (size_t {1 } != cRuntimeScores) {
171145 // muticlass
172- return PartitionMultiDimensionalFullTarget<true , k_cCompilerScoresStart>::Func (pInteractionCore,
173- cTensorBins,
174- flags,
175- regAlpha,
176- regLambda,
177- deltaStepMax,
178- aAuxiliaryBinsBase,
179- aBinsBase
180- );
146+ return PartitionMultiDimensionalFullTarget<true , k_cCompilerScoresStart>::Func (
147+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
181148 } else {
182- return PartitionMultiDimensionalFullInternal<true , k_oneScore>::Func (pInteractionCore,
183- cTensorBins,
184- flags,
185- regAlpha,
186- regLambda,
187- deltaStepMax,
188- aAuxiliaryBinsBase,
189- aBinsBase
190- );
149+ return PartitionMultiDimensionalFullInternal<true , k_oneScore>::Func (
150+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
191151 }
192152 } else {
193153 if (size_t {1 } != cRuntimeScores) {
194154 // Odd: gradient multiclass. Allow it, but do not optimize for it
195- return PartitionMultiDimensionalFullInternal<false , k_dynamicScores>::Func (pInteractionCore,
196- cTensorBins,
197- flags,
198- regAlpha,
199- regLambda,
200- deltaStepMax,
201- aAuxiliaryBinsBase,
202- aBinsBase
203- );
155+ return PartitionMultiDimensionalFullInternal<false , k_dynamicScores>::Func (
156+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
204157 } else {
205- return PartitionMultiDimensionalFullInternal<false , k_oneScore>::Func (pInteractionCore,
206- cTensorBins,
207- flags,
208- regAlpha,
209- regLambda,
210- deltaStepMax,
211- aAuxiliaryBinsBase,
212- aBinsBase
213- );
158+ return PartitionMultiDimensionalFullInternal<false , k_oneScore>::Func (
159+ pInteractionCore, cTensorBins, flags, regAlpha, regLambda, deltaStepMax, aAuxiliaryBinsBase, aBinsBase);
214160 }
215161 }
216162}
0 commit comments