示例#1
0
        private void TestPredict()
        {
            for (var i = 0; i < 50; i++)
            {
                List <Item> sample = this.SampleTestingInstance();
                var         y      = sample[0].Label; // ground truth label

                // forward prop it through the network
                var average = new Volume(1, 1, 10, 0.0);
                var n       = sample.Count;
                for (var j = 0; j < n; j++)
                {
                    var a = this.net.Forward(sample[j].Volume);
                    average.AddFrom(a);
                }

                var predictions = average.Select((w, k) => new { Label = k, Weight = w }).OrderBy(o => - o.Weight);
            }
        }