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