Esempio n. 1
0
 public void ModelTrainingConverges()
 {
     ImageData img = ResourceManager.UsingDebugBitmap("testgrid1px.png", (bmp) => {
         return ImageData.FromImage(bmp);
     });
     Label[,] labels = new Label[img.XSites,img.YSites];
     Classification cfc = new Classification(labels);
     ModelBuilder mbr = new ModelBuilder(ConcatenateFeatures.INSTANCE, LinearBasis.INSTANCE, 1d, 3000, 1d, 1d);
     Model mfm = mbr.PseudoLikelihoodTrain("","", new ImageData[1]{img},new Classification[1]{cfc});
     Assert.AreNotEqual(mfm.TimeToConverge, mbr.MaxIters);
 }
Esempio n. 2
0
 public void CanClassify()
 {
     ImageData img = ResourceManager.UsingDebugBitmap("testgrid1px.png", (bmp) => {
         return ImageData.FromImage(bmp);
     });
     Label[,] labels = new Label[img.XSites,img.YSites];
     Classification cfc = new Classification(labels);
     ModelBuilder mbr = new ModelBuilder(ConcatenateFeatures.INSTANCE, LinearBasis.INSTANCE, 1d, 3000, 1d, 1d);
     Model mfm = mbr.PseudoLikelihoodTrain("", "", new ImageData[1]{img},new Classification[1]{cfc});
     Classification inferred = mfm.MaximumAPosterioriInfer(img);
     Assert.IsNotNull(inferred);
 }