Is it possible to manually select cases from an array for training a neural network?
Show older comments
Hi all,
I’m trying to create a conventional backpropagation network to solve the XoR problem.
The input cases (and their respective targets) are:
0 0 (0)
1 0 (1)
0 1 (1)
1 1 (0)
Here is the issue: I need to take control of selecting each case for training the network (rather than the MATLAB default doing this for me). To do this, I am using simple code to select each case in turn and manually pass the case through the network.
I set up and configure the network using these commands
net = feedforwardnet(2);
net.trainFcn = 'traingdm';
net = configure (net, train_data,target_data);
('train_data' and 'target_data' are the names of the respective databases)
For each selected case, I present it to the network for training with the ‘adapt’ function
net = adapt(net,P,T);
(P and T are input and target values for the selected case)
Unfortunately, the network seems to be having trouble learning XoR solution. The system will produce the right answer only some of the time. That is, the network does not reliably learn the solution.
My questions is this: is it permissible for me to manually select each case in turn and run it through the network (as done above), or is case selection something that MATLAB needs to do itself?
Accepted Answer
More Answers (0)
Categories
Find more on Deep Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!