Example #1
0
        public void IniReaderTest()
        {
            var ini = new IniReader(@"cal.model.ini", 4096, 102);
            var v   = Vector <double> .Build.Dense(4096);

            var bias = TestNetwork.Score(v);
            int N    = 10;

            for (int b = 0; b < N; b++)
            {
                Assert.AreEqual(bias[b], ini.Bias[b], 1e-5);
            }
            for (int f = 0; f < 1000; f++)
            {
                v[f] = 1;
                var pred = TestNetwork.Score(v);
                v[f] = 0;
                for (int b = 0; b < N; b++)
                {
                    Assert.AreEqual(pred[b], ini.Bias[b] + ini.Weights[b * 4096 + f], 1e-5);
                }
            }
        }
Example #2
0
 public override IMatrix Apply(IMatrix m)
 {
     scores = TestNetwork.Score(m.GetColumn(0).Decrypt(null));
     return(m);
 }