Inheritance: Encog.ML.Data.Basic.BasicMLData
 public void ProcessWhatIs()
 {
     String filename = GetArg("image");
     try
     {
         var img = new Bitmap(filename);
         var input = new ImageMLData(img);
         input.Downsample(downsample, false, downsampleHeight,
                          downsampleWidth, 1, -1);
         int winner = network.Winner(input);
         app.WriteLine("What is: " + filename + ", it seems to be: "
                       + neuron2identity[winner]);
     }
     catch (Exception e)
     {
         app.WriteLine("Error loading: " + filename + ", " + e.Message);
     }
 }
        private void ProcessNetwork()
        {
            app.WriteLine("Downsampling images...");

            foreach (ImagePair pair in imageList)
            {
                var ideal = new BasicMLData(outputCount);
                int idx = pair.Identity;
                for (int i = 0; i < outputCount; i++)
                {
                    if (i == idx)
                    {
                        ideal[i] = 1;
                    }
                    else
                    {
                        ideal[i] = -1;
                    }
                }

                try
                {
                    var img = new Bitmap(pair.File);
                    var data = new ImageMLData(img);
                    training.Add(data, ideal);
                }
                catch (Exception e)
                {
                    app.WriteLine("Error loading: " + pair.File
                                  + ": " + e.Message);
                }
            }

            String strHidden1 = GetArg("hidden1");
            String strHidden2 = GetArg("hidden2");

            if (training.Count == 0)
            {
                app.WriteLine("No images to create network for.");
                return;
            }

            training.Downsample(downsampleHeight, downsampleWidth);

            int hidden1 = int.Parse(strHidden1);
            int hidden2 = int.Parse(strHidden2);

            network = EncogUtility.SimpleFeedForward(training
                                                         .InputSize, hidden1, hidden2,
                                                     training.IdealSize, true);
            app.WriteLine("Created network: " + network);
        }