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