MATLAB Answers

feedforward net, when divideFcn set to 'dividerand', what part of the data is used for training and for testing ?

3 views (last 30 days)
AYMERIC BARBIN
AYMERIC BARBIN on 2 Apr 2021
Answered: Prateek Rai on 16 Aug 2021
Hello,
If I construct a feedforward neural network like so:
net1=feedforwardnet(50,'traincgf');
net1=configure(net1,x,t); % input vector x, and label vector t
net1.divideFcn = 'dividerand'; % divide the data randomly
and after training, I call
a11=sim(net1,x); % simulate the network on vetor x
Does this takes into account the division of the data (specified by divideFcn) ? In other terms, does calling divideFcn use a part of x for the training ? and then another part of x when we call sim ?
Best regards
Aymeric

Answers (1)

Prateek Rai
Prateek Rai on 16 Aug 2021
To my understanding, you want to know whether calling 'divideFcn' uses a part of the input (here 'x') for the training and then another part of the input (here 'x') when calling the 'sim' function for simulating neural network.
'sim' function seems to work differently. It does not take into account the division of the data (specified by divideFcn). That division of data is only used for dividing data into training data, validating data, and testing data respectively.
When you call sim function then it will use the whole input for simulating the neural network.
For example,
a11=sim(net1,x);
here, 'sim' will simulate the neural network for the whole input i.e. for whole 'x'.
If you want to simulate the neural network only for testing data then you have to explicitly pass the testing data as input to sim function.
You can refer to the sim MathWorks documentation page to find more on simulating neural networks.

Community Treasure Hunt

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

Start Hunting!