14 writes to Weights
Microsoft.ML.StandardTrainers (14)
Standard\Online\AveragedLinear.cs (5)
167VBufferUtils.Densify(ref Weights); 174VBufferUtils.Densify(ref Weights); 215VectorUtils.ScaleInto(in TotalWeights, 1 / (float)NumWeightUpdates, ref Weights); 255VectorUtils.AddMult(in feat, biasUpdate / WeightsScale, ref Weights); 274VectorUtils.ScaleInto(in TotalWeights, 1 / (float)NumWeightUpdates, ref Weights);
Standard\Online\LinearSvm.cs (2)
165VBufferUtils.Densify(ref Weights); 251VectorUtils.AddMult(in weightsUpdate, rate * weightsUpdateScale / (_numBatchExamples * WeightsScale), ref Weights);
Standard\Online\OnlineLinear.cs (7)
142((IHaveFeatureWeights)predictor).GetFeatureWeights(ref Weights); 143VBufferUtils.Densify(ref Weights); 160Weights = new VBuffer<float>(numFeatures, weightValues); 168Weights = new VBuffer<float>(numFeatures, weightValues); 172Weights = VBufferUtils.CreateDense<float>(numFeatures); 174Weights = VBufferUtils.CreateEmpty<float>(numFeatures); 185VectorUtils.ScaleBy(ref Weights, WeightsScale);
15 references to Weights
Microsoft.ML.StandardTrainers (15)
Standard\Online\AveragedLinear.cs (5)
168Weights.CopyTo(ref TotalWeights); 203VectorUtils.AddMult(in Weights, NumNoUpdates * WeightsScale, ref TotalWeights); 240VectorUtils.AddMult(in Weights, NumNoUpdates * WeightsScale, ref TotalWeights); 288VectorUtils.AddMult(in Weights, WeightsScale, ref TotalWeights); 293VectorUtils.AddMult(in Weights, Gain * WeightsScale, ref TotalWeights);
Standard\Online\AveragedPerceptron.cs (1)
139Weights.CopyTo(ref weights);
Standard\Online\LinearSvm.cs (3)
260float normalizer = 1 / (MathUtils.Sqrt(_lambda) * VectorUtils.Norm(Weights) * Math.Abs(WeightsScale)); 275=> Bias + VectorUtils.DotProduct(in feat, in Weights) * WeightsScale; 281return new LinearBinaryModelParameters(ParentHost, Weights, Bias);
Standard\Online\OnlineGradientDescent.cs (1)
116Weights.CopyTo(ref weights);
Standard\Online\OnlineLinear.cs (5)
114/// The implicit scaling factor for <see cref="Weights"/>. Note that this does not affect <see cref="Bias"/>. 179/// Propagates the <see cref="WeightsScale"/> to the <see cref="Weights"/> vector. 191/// Conditionally propagates the <see cref="WeightsScale"/> to the <see cref="Weights"/> vector 239=> Bias + VectorUtils.DotProduct(in feat, in Weights) * WeightsScale; 300float maxNorm = Math.Max(VectorUtils.MaxNorm(in state.Weights), Math.Abs(state.Bias));