7 writes to WeightsScale
Microsoft.ML.StandardTrainers (7)
Standard\Online\AveragedLinear.cs (3)
216
WeightsScale
= 1;
256
WeightsScale
*= 1 - 2 * _args.L2Regularization; // L2 regularization.
275
WeightsScale
= 1;
Standard\Online\LinearSvm.cs (2)
249
WeightsScale
*= 1 - rate * _lambda;
264
WeightsScale
*= normalizer;
Standard\Online\OnlineLinear.cs (2)
175
WeightsScale
= 1;
186
WeightsScale
= 1;
20 references to WeightsScale
Microsoft.ML.StandardTrainers (20)
Standard\Online\AveragedLinear.cs (6)
203
VectorUtils.AddMult(in Weights, NumNoUpdates *
WeightsScale
, ref TotalWeights);
240
VectorUtils.AddMult(in Weights, NumNoUpdates *
WeightsScale
, ref TotalWeights);
241
TotalBias += Bias * NumNoUpdates *
WeightsScale
;
255
VectorUtils.AddMult(in feat, biasUpdate /
WeightsScale
, ref Weights);
288
VectorUtils.AddMult(in Weights,
WeightsScale
, ref TotalWeights);
293
VectorUtils.AddMult(in Weights, Gain *
WeightsScale
, ref TotalWeights);
Standard\Online\AveragedPerceptron.cs (1)
132
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\LinearSvm.cs (4)
251
VectorUtils.AddMult(in weightsUpdate, rate * weightsUpdateScale / (_numBatchExamples *
WeightsScale
), ref Weights);
260
float normalizer = 1 / (MathUtils.Sqrt(_lambda) * VectorUtils.Norm(Weights) * Math.Abs(
WeightsScale
));
275
=> Bias + VectorUtils.DotProduct(in feat, in Weights) *
WeightsScale
;
279
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\OnlineGradientDescent.cs (1)
110
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\OnlineLinear.cs (8)
108
/// Current weights. The weights vector is considered to be scaled by <see cref="
WeightsScale
"/>. Storing this separately
179
/// Propagates the <see cref="
WeightsScale
"/> to the <see cref="Weights"/> vector.
183
if (
WeightsScale
!= 1)
185
VectorUtils.ScaleBy(ref Weights,
WeightsScale
);
191
/// Conditionally propagates the <see cref="
WeightsScale
"/> to the <see cref="Weights"/> vector
197
float absWeightsScale = Math.Abs(
WeightsScale
);
239
=> Bias + VectorUtils.DotProduct(in feat, in Weights) *
WeightsScale
;
299
ch.Assert(state.
WeightsScale
== 1);