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