How do i approximate non-linear function with neural networks and work with performance plot?
12 次查看(过去 30 天)
显示 更早的评论
I have to approximate nonlinear function with neural network. The number of layers and number of neurons in layers are chosen by me. Suppose i have a certain dataset (attached).
Dataset contains 7 variables. T1-T5 are used to create function (see code) and X1 and X2 are inputs.
Now my code just does not work as intended. I am not even sure this is correct so a confirmation would be nice ☺.
But now the real problem. After i train the network, the performance graph shows three lines, one for training, one for validation and one for test. How can i change it. I only used train command for training set and it divided the training set into validation, training and test.
Lets suppose I join those three together into the big one. How does the algorithm decide how to divide them? Does it divide the data evenly? Can i decide how it will be divided?
load 'Data_Problem1_regression.mat';
Tnew = (8*T1 + 5*T2 + 2*T3 + 1*T4 + 0*T5)/(8+5+2+1+0); %this is given from the exercise. This is the function output
training = Tnew(1:1000)'; % 1000 samples from Tnew are supposed to be training (transposed for network to work)
validation = Tnew(1001:2000)'; % 1000 for validation
test = Tnew(2001:3000)'; % 1000 for testing.
x = {X1(1:1000)';X2(1:1000)'}; % Neural netowork will have two inputs.
%%
net1=feedforwardnet(12,'trainlm');
net1.numinputs = 2;
view(net1)
net1 = train(net1,x,training); % only giving "training" set as an argument but the performance plot will have 3 lines

0 个评论
采纳的回答
Srivardhan Gadila
2020-3-4
The net1 from above has the function divideFcn as Object property. This property defines the data division function to be used when the network is trained using a supervised algorithm, such as backpropagation. You can set this property to the name of a division function.
For a list of functions, type "help nndivision" in command window
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!