Is it possible to manually select cases from an array for training a neural network?

1 次查看(过去 30 天)
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?

采纳的回答

Greg Heath
Greg Heath 2014-5-24
No. The net must process the inputs together (batch or sequential). Otherwise the net will forget the characteristics of previous inputs.
Hope this helps
Thank you for formally accepting my answer
Greg
  3 个评论
Greg Heath
Greg Heath 2014-5-28
I am completely baffled.
The info that you want to store is meaningless.
Why in the world would you want to do this??
Greg Heath
Greg Heath 2014-5-30
The simple answer is no. In multivariable problems it is very seldom that the answer can be obtained by sequencing multiple significant operations of different inputs.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sequence and Numeric Feature Data Workflows 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by