6

So here is shown a simple example - 2 floats as data + 1 float as output:

           Layer 1: 2 neurons (2 inputs)
           Layer 2: 3 neurons (hidden layer)
           Layer 3: 3 neurons (hidden layer)
           Layer 4: 1 neurons (1 output)

And we create ANs with something like

  cvSet1D(&neuralLayers1, 0, cvScalar(2));
   cvSet1D(&neuralLayers1, 1, cvScalar(3));
   cvSet1D(&neuralLayers1, 2, cvScalar(3));
   cvSet1D(&neuralLayers1, 3, cvScalar(1));

And than we just tall openCV to train our network.

I wonder if we had Nx2 floats of data + 1 float as for output and we would want to give first neuron as input first line (N floats) and to second neuron second line (N float data elements) what would we need to add to our code?

ergosys
  • 43,069
  • 5
  • 38
  • 67
Rella
  • 59,216
  • 102
  • 341
  • 614
  • I'm not so sure that you can do that .... OpenCv has a KNN implementation that you can use for multidimensional data – Kevin Apr 12 '11 at 15:26

1 Answers1

1

I would definitely use the KNN mentioned.

Bradley Powers
  • 677
  • 7
  • 17
  • Ok +1... So Are there any tutorials [like this one on ANN](http://projectagv.blogspot.com/2008/12/sample-code-for-cvannmlp.html) on KNN? – Rella May 06 '11 at 08:56
  • This is the best one I've found: http://www.aishack.in/2010/10/k-nearest-neighbors-in-opencv/ This site is quite nice – Bradley Powers May 06 '11 at 22:38