neural net toolbox: divideFcn = ''

Hello,
I read a lot of Q&A about neural nets on MATALB Answers lately. Someone (sadly I wasn't able to find the post again) mentioned to set the dividing funcion of the input data to ''. i.e.
NN = narxnet(0:5, 1:5, [10 10]); % creation of a narxnet
NN.divideFcn = ''; % usually I use 'divideblock' here
I get different results for NN.divideFcn = '' or NN.divideFcn = 'divideblock'.
My question is: How does this divideFcn behave. Or does this line of code lead to some default value for the divideFcn?
Thank you in advance for your answers.

 Respuesta aceptada

Greg Heath
Greg Heath el 9 de Dic. de 2015

0 votos

In general you can specify
1. The type of data division
2. The trn/val/test ratios
If you don't specify anything, you will get the default of random data division with trn/val/test ratios 0.7/0.15/0.15.
If you specify ' ' or 'dividetrain', you will get no division i.e., 100/0/0.
If you only specify 'divideblock' the data will be divided into 3 solid blocks of trn/val/test with the default 0.7/0.15/0.15 ratios. However, you can also specify another set of block ratios. This is the datadivision I typically recommend for timeseries prediction.
The disappointing part of this thread is that you should have figured this out by
1. Reading the help and doc documentations for the
different datadivision options.
2. Demonstrating the options on a small data example.
For example,
input = 1:10; target = input.^2;
Hope this helps.
Thank you for formally accepting my answer

4 comentarios

Greg Heath
Greg Heath el 9 de Dic. de 2015
Editada: Greg Heath el 4 de En. de 2016
>> lookfor divide ...
divideblock - Partition indices into three sets using blocks of indices.
divideind - Partition indices into three sets using specified indices.
divideint - Partition indices into three sets using interleaved indices.
dividerand - Partition indices into three sets using random indices.
dividetrain - Partition indices into training set only.
% net.divideFcn = ' '; is the same as net.divideFcn = dividetrain';
>> help divideblock
[trainInd,valInd,testInd] =
divideblock(Q,trainRatio,valRatio,testRatio)
takes a number of samples Q and divides up the sample indices
1:Q between training, validation and test indices.
divideblock returns the first N1 indices as trainInd, the next
N2 indices as valInd and the remaining N3 indices as testInd.
The sum of N1, N2 and N3 is Q, and the proportions between them
match the three ratios.
For example, here 250 samples are divided into 70% for training,
15% for validation and 15% for testing.
[trainInd,valInd,testInd] = divideblock(250,0.7,0.15,0.15)
Here is how to ensure a network will perform the same kind of
data division when it is trained:
net.divideFcn = 'divideblock';
net.divideParam.trainRatio = 0.7;
net.divideParam.valRatio = 0.15;
net.divideParam.testRatio = 0.15.
See also divideind, divideint, dividerand, dividetrain.
Reference page in Help browser
doc divideblock
>> doc divideblock
....
% REPEAT FOR THE OTHER FOUR OPTIONS
Fabio Muratore
Fabio Muratore el 9 de Dic. de 2015
Thank you Greg Heath. I recognize that this would have been easy to figure out...
For people with the same question: This information was essential for me
dividetrain - Partition indices into training set only.
net.divideFcn = ' '; % is the same as net.divideFcn = dividetrain';
-----
But there appears a new question out of your answer:
How does a neural network, e.g. narxnet, learn (supervised learning) without targets?
Greg Heath
Greg Heath el 10 de Dic. de 2015
Editada: Greg Heath el 4 de En. de 2016
If you look at the figures in the help and doc documentation, you will see that
timedelaynet is trained with targets and external inputs; and
deployed with external inputs that generate outputs.
narnet is trained in the open-loop (OL) configuration with
targets replacing external inputs. It is deployed in the
closed-loop (CL) configuration with output feedback replacing
the open-loop target inputs.
narxnet is trained in the OL configuration with both external
inputs and target inputs. It is deployed with external inputs
and output feedback replacing OL target inputs.
Hope this helps.
Greg
bear96
bear96 el 1 de En. de 2020
Hello, I was wondering if there is any way to obtain the testing/validation/training samples that have been specified by 'dividerand'?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 8 de Dic. de 2015

Comentada:

el 1 de En. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by