7 writes to WeightsScale
Microsoft.ML.StandardTrainers (7)
Standard\Online\AveragedLinear.cs (3)
212
WeightsScale
= 1;
252
WeightsScale
*= 1 - 2 * _args.L2Regularization; // L2 regularization.
271
WeightsScale
= 1;
Standard\Online\LinearSvm.cs (2)
232
WeightsScale
*= 1 - rate * _lambda;
247
WeightsScale
*= normalizer;
Standard\Online\OnlineLinear.cs (2)
173
WeightsScale
= 1;
184
WeightsScale
= 1;
20 references to WeightsScale
Microsoft.ML.StandardTrainers (20)
Standard\Online\AveragedLinear.cs (6)
199
VectorUtils.AddMult(in Weights, NumNoUpdates *
WeightsScale
, ref TotalWeights);
236
VectorUtils.AddMult(in Weights, NumNoUpdates *
WeightsScale
, ref TotalWeights);
237
TotalBias += Bias * NumNoUpdates *
WeightsScale
;
251
VectorUtils.AddMult(in feat, biasUpdate /
WeightsScale
, ref Weights);
284
VectorUtils.AddMult(in Weights,
WeightsScale
, ref TotalWeights);
289
VectorUtils.AddMult(in Weights, Gain *
WeightsScale
, ref TotalWeights);
Standard\Online\AveragedPerceptron.cs (1)
131
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\LinearSvm.cs (4)
234
VectorUtils.AddMult(in weightsUpdate, rate * weightsUpdateScale / (_numBatchExamples *
WeightsScale
), ref Weights);
243
float normalizer = 1 / (MathUtils.Sqrt(_lambda) * VectorUtils.Norm(Weights) * Math.Abs(
WeightsScale
));
258
=> Bias + VectorUtils.DotProduct(in feat, in Weights) *
WeightsScale
;
262
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\OnlineGradientDescent.cs (1)
109
Contracts.Assert(
WeightsScale
== 1);
Standard\Online\OnlineLinear.cs (8)
106
/// Current weights. The weights vector is considered to be scaled by <see cref="
WeightsScale
"/>. Storing this separately
177
/// Propagates the <see cref="
WeightsScale
"/> to the <see cref="Weights"/> vector.
181
if (
WeightsScale
!= 1)
183
VectorUtils.ScaleBy(ref Weights,
WeightsScale
);
189
/// Conditionally propagates the <see cref="
WeightsScale
"/> to the <see cref="Weights"/> vector
195
float absWeightsScale = Math.Abs(
WeightsScale
);
237
=> Bias + VectorUtils.DotProduct(in feat, in Weights) *
WeightsScale
;
297
ch.Assert(state.
WeightsScale
== 1);