@@ -35,8 +35,7 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalF
35
35
const FloatCalc regLambda,
36
36
const FloatCalc deltaStepMax,
37
37
BinBase* const aAuxiliaryBinsBase,
38
- BinBase* const aBinsBase
39
- ) {
38
+ BinBase* const aBinsBase) {
40
39
auto * const aAuxiliaryBins =
41
40
aAuxiliaryBinsBase
42
41
->Specialize <FloatMain, UIntMain, true , true , bHessian, GetArrayScores (cCompilerScores)>();
@@ -46,7 +45,6 @@ template<bool bHessian, size_t cCompilerScores> class PartitionMultiDimensionalF
46
45
const size_t cScores = GET_COUNT_SCORES (cCompilerScores, pInteractionCore->GetCountScores ());
47
46
const size_t cBytesPerBin = GetBinSize<FloatMain, UIntMain>(true , true , bHessian, cScores);
48
47
49
-
50
48
Bin<FloatMain, UIntMain, true , true , bHessian, GetArrayScores (cCompilerScores)> totalBin;
51
49
static constexpr bool bUseStackMemory = k_dynamicScores != cCompilerScores;
52
50
auto * const aTotalGradPair = bUseStackMemory ? totalBin.GetGradientPairs () : aAuxiliaryBins->GetGradientPairs ();
@@ -103,28 +101,13 @@ template<bool bHessian, size_t cPossibleScores> class PartitionMultiDimensionalF
103
101
const FloatCalc regLambda,
104
102
const FloatCalc deltaStepMax,
105
103
BinBase* aAuxiliaryBinsBase,
106
- BinBase* const aBinsBase
107
- ) {
104
+ BinBase* const aBinsBase) {
108
105
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);
118
108
} 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);
128
111
}
129
112
}
130
113
};
@@ -140,17 +123,9 @@ template<bool bHessian> class PartitionMultiDimensionalFullTarget<bHessian, k_cC
140
123
const FloatCalc regLambda,
141
124
const FloatCalc deltaStepMax,
142
125
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);
154
129
}
155
130
};
156
131
@@ -161,56 +136,27 @@ extern double PartitionMultiDimensionalFull(InteractionCore* const pInteractionC
161
136
const FloatCalc regLambda,
162
137
const FloatCalc deltaStepMax,
163
138
BinBase* aAuxiliaryBinsBase,
164
- BinBase* const aBinsBase
165
- ) {
139
+ BinBase* const aBinsBase) {
166
140
const size_t cRuntimeScores = pInteractionCore->GetCountScores ();
167
141
168
142
EBM_ASSERT (1 <= cRuntimeScores);
169
143
if (pInteractionCore->IsHessian ()) {
170
144
if (size_t {1 } != cRuntimeScores) {
171
145
// 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);
181
148
} 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);
191
151
}
192
152
} else {
193
153
if (size_t {1 } != cRuntimeScores) {
194
154
// 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);
204
157
} 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);
214
160
}
215
161
}
216
162
}
0 commit comments