Professional Documents
Culture Documents
WEEK 6 MODULE 6 - Neural Network Models
WEEK 6 MODULE 6 - Neural Network Models
MODULE 6:
Empirical Modeling Using Artificial Neural Networks (ANN)
neural network can have any number of inputs, but only one output that is
(6.40)
includes:
sigmoid function
hyperbolic tangent function
sine function
linear and saturated linear function
ReLU
SPOCU
Obafemi Awolowo University 11
Chemical Engineering
The Structure of an ANN model
(6.41)
(6.42)
(6.43)
output respectively.
and are input bias matrix and output bias matrix. is the activation
function for the hidden layer. Tansig activation function is given by:
(6.44)
(6.45)
(6.46)
The unknown parameters in an ANN model are the weights (output and
input) and the biases (output and input). These parameters are usually
estimated using input/output data set.
The iterative process of calculating the weights and the biases in a neural
network is referred to as training. It is a highly intensive optimization
process but algorithms abound in literatures for doing this. MATLAB
(2015a) neural network toolbox is employed in this work for the training.
Usually the input/output data set is divided into the training set and the
validation set.
STEP 2: Enter the data below and invoke the function as follows:
9.8974 2.5319,
(b) The subroutine in MATLAB for fitting FFNN to this data is called
“fitnet”. Enter the following into the command prompt/m-file:
x = [0.1, 0.2, 0.4, 0.6, 0.9, 1.3, 1.5, 1.7, 1.8];
y = [0.75, 1.25, 1.45, 1.25, 0.85, 0.55, 0.35, 0.28, 0.18];
p=[x] ;
t=[y] ;
net=fitnet(5) ;
net.divideFcn = '' ;
net.trainParam.epochs = 6000;
net.trainParam.max_fail = 10000;
net.trainParam.min_grad=1e-15;
net.trainParam.show = 50;
net.trainParam.lr=0.01;
net.trainParam.goal = 0;
%%%%%%%%%%%%%%%%%%%%
net = init(net);
[net, tr] = train(net,p,t);
out1 = sim(net,p);
out1=out1';
genFunction(net,'save_net', 'MatrixOnly','yes');
figure(1)
plot(p, t, '*b',p,out1,'r','LineWidth',2)
legend('Actual Data','ANN model prediction')
xlabel('x')
ylabel('y')
Fig. 6.27: A comparison between the actual data and the ANN model prediction
Table 6.11: Comparison between actual, regressed and FFNN model prediction