-1

need some help regarding training of neural network. to give you the background i have trained and tested my neural network for AND and OR and seems to work fine. FYI i am using back-propagation neural network.

So coming to the problem i want to use this neural network to classify a coordinate in space to class A or class B. For this i have generated a test data of 10000 entries each between a range for each input x and y. Now how should i train my neural network should i sequentially parse each test data or should take random training set from each of training data??

Any help will be appreciated.

arogachev
  • 33,150
  • 7
  • 114
  • 117
KungFu_Panda
  • 111
  • 11
  • I'm a bit confused by your wording in your last sentence. You want to know how to split your data into a training and test set? You know that test data is not for training, right? – runDOSrun Feb 16 '15 at 11:21
  • yeah i know that..see i have 2 text files with training data for each class A and B and now i want to know that should i take training entries from each of these sets randomly or should i parse whole class A set first and then the class B set. – KungFu_Panda Feb 16 '15 at 11:24

2 Answers2

0

What I learnt on studies:

There are many methods of training neural networks.

  1. You can use 3000 examples of class A and 3000 of class B to train network (pass these 6000 examples and then propagate wrong/good classification). If function (mathematic) that classify x,y coordinates to A/B is simple (like line 'y=2x+3') you should use few neurons, of course big network will learn these x,y too, but it will require more time (need to pass these 6000 example X times to learn it). Then use 4000 examples to test how many % is right classified.

  2. or do same, but with 10000 elements to learn and then 10000 elements to test.

JerzySkalski
  • 624
  • 7
  • 9
0

As far as I understand your question from your comment, the sequence in which you input your training data does not matter. You can input all A-samples, then proceed with B-samples or you can randomly throw them together. As long as at the end of the training, you will have used the same set you'll get the exact same result.

Edit: Since you're using the word test in your question, be aware that you'll have to take some samples from your 2 files that you will only use for testing and not training (different to logical functions). For this reason one usually uses random sampling because you want your labels evenly split between both sets: E.g. you don't want to train only class A and then test class B.

runDOSrun
  • 10,359
  • 7
  • 47
  • 57
  • i trained my neural network as you specified keeping some of the non-trained inputs aside for testing but it seems that i am getting result from the neural network as the result of training set trained in the last of my training...like if the order of training was class A then class b then i am getting output now is that of class b and if order of training was class b then class a then my output for test is coming out to be always of that of class a.. so it has to be training error right? it has to do something with the order? – KungFu_Panda Feb 16 '15 at 12:08
  • If you input a B sample it will output B if its correctly trained. It's hard to understand your problem. Just compare training and test error while you change the sets – runDOSrun Feb 16 '15 at 12:29
  • Btw if you implemented the network from scratch, you might want to use a library first to learn the basics and test some questions (like yours). – runDOSrun Feb 16 '15 at 12:38