3 writes to NumberOfClasses
Microsoft.ML.StandardTrainers (3)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (3)
460NumberOfClasses = numClasses; 506NumberOfClasses = numClasses; 554NumberOfClasses = ctx.Reader.ReadInt32();
42 references to NumberOfClasses
Microsoft.ML.StandardTrainers (42)
Standard\LogisticRegression\MulticlassLogisticRegression.cs (42)
467Contracts.Assert(weights.Length == NumberOfClasses + NumberOfClasses * NumberOfFeatures); 469Biases = new float[NumberOfClasses]; 472Weights = new VBuffer<float>[NumberOfClasses]; 474weights.CopyTo(ref Weights[i], NumberOfClasses + i * NumberOfFeatures, NumberOfFeatures); 479OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses); 509Contracts.Check(Utils.Size(weights) == NumberOfClasses); 510Contracts.Check(Utils.Size(bias) == NumberOfClasses); 511Weights = new VBuffer<float>[NumberOfClasses]; 512Biases = new float[NumberOfClasses]; 513for (int iClass = 0; iClass < NumberOfClasses; iClass++) 524OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses); 555Host.CheckDecode(NumberOfClasses >= 1); 557Biases = ctx.Reader.ReadFloatArray(NumberOfClasses); 567Host.CheckDecode(numWeights == NumberOfClasses * NumberOfFeatures); 568Weights = new VBuffer<float>[NumberOfClasses]; 579Host.CheckDecode(numStarts == NumberOfClasses + 1); 587var indices = new int[NumberOfClasses][]; 597Weights = new VBuffer<float>[NumberOfClasses]; 606OutputType = new VectorDataViewType(NumberDataViewType.Single, NumberOfClasses); 629Host.Assert(Biases.Length == NumberOfClasses); 652ctx.Writer.Write(NumberOfClasses); 653ctx.Writer.WriteSinglesNoCount(Biases.AsSpan(0, NumberOfClasses)); 671ctx.Writer.Write(NumberOfClasses + 1); 789var editor = VBufferEditor.Create(ref dst, NumberOfClasses); 805var weightsDense = new VBuffer<float>[NumberOfClasses]; 909writer.WriteLine(string.Format("var scores = new float[{0}];", NumberOfClasses)); 996node.AddAttribute("classlabels_ints", Enumerable.Range(1, NumberOfClasses).Select(x => (long)x)); 1031numClasses = NumberOfClasses; 1032Utils.EnsureSize(ref weights, NumberOfClasses, NumberOfClasses); 1033for (int i = 0; i < NumberOfClasses; i++) 1061Contracts.Assert(0 <= classNumber && classNumber < NumberOfClasses); 1069string[] labelNames = new string[NumberOfClasses]; 1070for (int i = 0; i < NumberOfClasses; i++) 1086Contracts.Assert(Utils.Size(_labelNames) == NumberOfClasses); 1087for (int i = 0; i < NumberOfClasses; i++) 1105bldr.AddColumn("ClassNames", Enumerable.Range(0, NumberOfClasses).Select(i => GetLabelName(i)).ToArray()); 1241Host.Assert(dst.Length == NumberOfClasses); 1245float softmax = MathUtils.SoftMax(dst.Slice(0, NumberOfClasses)); 1246for (int i = 0; i < NumberOfClasses; ++i) 1255writer.WriteLine(string.Format("var softmax = MathUtils.SoftMax({0}.AsSpan(0, {1}));", scoresName, NumberOfClasses));