% Neural Network % Created Wed Nov 08 01:33:00 2017 % Dragan Milicevic close all clear all clc % Set input data. Inputs = [ 65.86 74.43 78.89 98.16 66.22 162.95 155.28 63.90 69.61 75.32 89.78 63.54 155.99 148.14 83.17 83.17 58.90 151.35 76.92 145.82 57.47 141.36 68.89 123.87 110.30 112.80 212.39 221.32 230.24 228.45 232.02 232.02 249.87 208.82 214.18 223.10 221.32 223.10 223.10 240.95 208.82 214.18 210.61 215.96 212.39 233.81 210.61 208.82 207.04 205.25 212.39 199.90 207.04 224.88 223.10 274.86 276.64 242.73 260.58 265.94 215.96 217.75 264.15 265.94 233.81 257.01 255.94 214.18 260.58 264.15 226.67 249.87 241.84 260.58 223.10 244.52 229.53 240.95 221.85 0.038 0.075 0.150 0.300 0.600 1.200 1.500 0.038 0.075 0.150 0.300 0.600 1.200 1.500 0.150 0.300 0.600 1.200 1.300 1.500 0.600 1.200 1.300 1.500 0.600 1.500 0.075 0.150 0.300 0.600 1.200 1.500 1.800 0.075 0.150 0.300 0.600 1.200 1.500 1.800 0.150 0.300 0.600 1.200 1.500 1.800 0.300 0.600 1.200 1.500 1.800 1.500 1.800 0.075 0.150 0.300 0.600 1.200 1.500 1.800 0.075 0.150 0.300 0.600 1.200 1.500 1.800 0.150 0.300 0.600 1.200 1.500 1.800 0.600 1.200 1.500 1.800 1.500 1.800 4 4 4 4 4 4 4 16 16 16 16 16 16 16 36 36 36 36 36 36 64 64 64 64 100 100 4 4 4 4 4 4 4 16 16 16 16 16 16 16 36 36 36 36 36 36 64 64 64 64 64 100 100 4 4 4 4 4 4 4 16 16 16 16 16 16 16 36 36 36 36 36 36 64 64 64 64 100 100 ] % Set target data. Targets = [ 63.90 69.61 75.32 89.78 63.54 155.99 148.14 50.33 66.04 74.25 83.17 58.90 151.35 145.82 74.43 78.89 58.18 141.36 71.93 123.87 56.94 134.22 64.97 112.80 98.16 100.84 208.82 214.18 223.10 221.32 223.10 223.10 240.95 205.25 208.82 214.18 210.61 215.96 212.39 233.81 207.04 210.61 208.82 207.04 205.25 212.39 207.04 203.47 201.68 199.90 207.04 196.33 199.90 215.96 217.75 264.15 265.94 233.81 257.01 255.94 212.39 214.18 260.58 264.15 226.67 249.87 241.84 207.04 257.01 260.58 223.10 244.52 229.53 258.80 221.32 240.95 221.85 233.81 216.50 ] % Create a feed-forward backpropagation network with one hidden layer, 9 nodes in hidden layer, % with input and output layer net = feedforwardnet(9); % Setup Division of Data for Training, Validation, Testing net.divideFcn='dividerand' net.divideMode = 'sample' net.divideParam.trainRatio = 70/100; net.divideParam.valRatio = 15/100; net.divideParam.testRatio = 15/100; % Set feed-forward backpropagation network train params net.trainParam.show = 25 net.trainParam.epochs = 2000 net.trainParam.goal = 0 net.trainParam.min_grad = 1e-05 net.trainParam.max_fail = 2000 net.trainParam.mu = 0.0001 net.trainParam.mu_dec = 0.1 net.trainParam.mu_inc = 10 net.trainParam.mu_max = 10000000000 net.trainParam.lr = 0.25 % Choose Plot Functions net.plotFcns = {'plotperform','plottrainstate','ploterrhist', 'plotregression'}; % Train the Network net = train(net, Inputs, Targets) % Test the Network Outputs = net(Inputs) Errors = gsubtract(Targets, Outputs); Performance = perform(net, Targets, Outputs)