Ejemplo n.º 1
0
        public override float[] GetPredictedLabels(float threshold = 0f)
        {
            Outputs.CopyToHost();
            var res = new float[MinibatchSize];

            for (var minibatchNo = 0; minibatchNo < MinibatchSize; minibatchNo++)
            {
                var maxLabel       = float.MinValue;
                var maxLabelChance = float.MinValue;
                for (var labelNo = 0; labelNo < this.Size; labelNo++)
                {
                    var labelChance = Outputs[minibatchNo, labelNo];
                    if (labelChance > maxLabelChance)
                    {
                        maxLabel       = labelNo;
                        maxLabelChance = labelChance;
                    }
                    res[minibatchNo] = maxLabel;
                }
            }
            return(res);
        }