14 writes to Weights
Microsoft.ML.StandardTrainers (14)
Standard\Online\AveragedLinear.cs (5)
163VBufferUtils.Densify(ref Weights); 170VBufferUtils.Densify(ref Weights); 211VectorUtils.ScaleInto(in TotalWeights, 1 / (float)NumWeightUpdates, ref Weights); 251VectorUtils.AddMult(in feat, biasUpdate / WeightsScale, ref Weights); 270VectorUtils.ScaleInto(in TotalWeights, 1 / (float)NumWeightUpdates, ref Weights);
Standard\Online\LinearSvm.cs (2)
148VBufferUtils.Densify(ref Weights); 234VectorUtils.AddMult(in weightsUpdate, rate * weightsUpdateScale / (_numBatchExamples * WeightsScale), ref Weights);
Standard\Online\OnlineLinear.cs (7)
140((IHaveFeatureWeights)predictor).GetFeatureWeights(ref Weights); 141VBufferUtils.Densify(ref Weights); 158Weights = new VBuffer<float>(numFeatures, weightValues); 166Weights = new VBuffer<float>(numFeatures, weightValues); 170Weights = VBufferUtils.CreateDense<float>(numFeatures); 172Weights = VBufferUtils.CreateEmpty<float>(numFeatures); 183VectorUtils.ScaleBy(ref Weights, WeightsScale);
15 references to Weights
Microsoft.ML.StandardTrainers (15)
Standard\Online\AveragedLinear.cs (5)
164Weights.CopyTo(ref TotalWeights); 199VectorUtils.AddMult(in Weights, NumNoUpdates * WeightsScale, ref TotalWeights); 236VectorUtils.AddMult(in Weights, NumNoUpdates * WeightsScale, ref TotalWeights); 284VectorUtils.AddMult(in Weights, WeightsScale, ref TotalWeights); 289VectorUtils.AddMult(in Weights, Gain * WeightsScale, ref TotalWeights);
Standard\Online\AveragedPerceptron.cs (1)
138Weights.CopyTo(ref weights);
Standard\Online\LinearSvm.cs (3)
243float normalizer = 1 / (MathUtils.Sqrt(_lambda) * VectorUtils.Norm(Weights) * Math.Abs(WeightsScale)); 258=> Bias + VectorUtils.DotProduct(in feat, in Weights) * WeightsScale; 264return new LinearBinaryModelParameters(ParentHost, Weights, Bias);
Standard\Online\OnlineGradientDescent.cs (1)
115Weights.CopyTo(ref weights);
Standard\Online\OnlineLinear.cs (5)
112/// The implicit scaling factor for <see cref="Weights"/>. Note that this does not affect <see cref="Bias"/>. 177/// Propagates the <see cref="WeightsScale"/> to the <see cref="Weights"/> vector. 189/// Conditionally propagates the <see cref="WeightsScale"/> to the <see cref="Weights"/> vector 237=> Bias + VectorUtils.DotProduct(in feat, in Weights) * WeightsScale; 298float maxNorm = Math.Max(VectorUtils.MaxNorm(in state.Weights), Math.Abs(state.Bias));