4 writes to Weights
Microsoft.ML.StandardTrainers (4)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (4)
472Weights = new VBuffer<float>[NumberOfClasses]; 511Weights = new VBuffer<float>[NumberOfClasses]; 568Weights = new VBuffer<float>[NumberOfClasses]; 597Weights = new VBuffer<float>[NumberOfClasses];
39 references to Weights
Microsoft.ML.StandardTrainers (39)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (39)
473for (int i = 0; i < Weights.Length; i++) 474weights.CopyTo(ref Weights[i], NumberOfClasses + i * NumberOfFeatures, NumberOfFeatures); 475if (Weights.All(v => v.IsDense)) 476_weightsDense = Weights; 516weights[iClass].CopyTo(ref Weights[iClass]); 520if (Weights.All(v => v.IsDense)) 521_weightsDense = Weights; 569for (int i = 0; i < Weights.Length; i++) 572Weights[i] = new VBuffer<float>(NumberOfFeatures, w); 574_weightsDense = Weights; 598for (int i = 0; i < Weights.Length; i++) 601Weights[i] = new VBuffer<float>(NumberOfFeatures, Utils.Size(values), values, indices[i]); 630Host.Assert(Biases.Length == Weights.Length); 632foreach (var fw in Weights) 657if (Weights == _weightsDense) 661ctx.Writer.Write(NumberOfFeatures * Weights.Length); 662foreach (var fv in Weights) 676for (int i = 0; i < Weights.Length; i++) 685numIndices += NonZeroCount(in Weights[i]); 693foreach (var fw in Weights) 721foreach (var fw in Weights) 785var weights = Weights; 801lock (Weights) 806for (int i = 0; i < Weights.Length; i++) 810var w = Weights[i]; 827/// by using inner product of the i-th linear coefficient vector <see cref="Weights"/>[i] and the input feature vector (plus bias). 848for (int classNumber = 0; classNumber < Weights.Length; classNumber++) 850var orderedWeights = Weights[classNumber].Items().OrderByDescending(kv => Math.Abs(kv.Value)); 914in Weights[i], 956predictor["coeff"] = new JArray(Weights.Select(w => new JArray(w.DenseValues()))); 994node.AddAttribute("coefficients", Weights.SelectMany(w => w.DenseValues())); 1034Weights[i].CopyTo(ref weights[i]); 1047Contracts.Assert(Weights.Length == Biases.Length); 1049int featuresCount = Weights[0].Length; 1050for (var i = 0; i < Weights.Length; i++) 1052Host.Assert(featuresCount == Weights[i].Length); 1053foreach (var weight in Weights[i].Items(all: true)) 1104bldr.AddColumn("Weights", getSlotNames, NumberDataViewType.Single, Weights); 1120AnnotationUtils.GetSlotNames(schema, RoleMappedSchema.ColumnRole.Feature, Weights.Length, ref names);