hello everyone in this video tutorial we
are going to discuss how to write the
script for creating data fitting neural
network in MATLAB in the last video we
have discussed the graphic user
interface for the same so I've already
written the code in this video we will
be discussing this code line by line so
what we basically will be doing is like
creating a random function and then
providing it with the inputs and then
obtaining the output from it
then we will provide some test data to
this created function as well as the I
want trained Network and then compare
those two results obtained to check the
accuracy of the network so let's begin
with it these are the standard commands
and so I have created X 1 X 2 and X 3 as
input by providing any random by
choosing a random integer with maximum
value of 100 and 100 inputs and
providing then combining these into a
single array this is the function I am
talking about so in this I will
providing x1 x2 and x3 as the input and
Y will be the output so this is the
function I was talking about this is
just a random function so this will
contain 100 values this command gives
you to any function of train via this
gives a number of it and neurons as 10
this is Fitness is the standard inbuilt
MATLAB command for data fitting neural
network so if we provide it with the
number of hidden neurons and the
training function this line shows that
the processing we have to do for the
inputs we have supplied this as the
MATLAB inbuilt possessing functions we
move constant row and may mimic the more
constant or removes the constant rows
that we may be supplying as it will use
the accuracy of the network map min max
is just for creating the inputs where in
a particular range device function we
are using divided Wrentham
for n double dividing the data set we
have available divide mode is sample
this line shows the ratio in which will
divide the data in the training
validation and test
the number of epochs or the duration are
specified by this the performance
function is mean square error I have
used that this train is the MATLAB
command for training the network we have
created so supplied within Network the
inputs and the target will require so
this will train the network and after
that you can view the network test in
this line I have created the test data
of five data set so I will be providing
this to the function and created as well
as the network I updated so profiles
provided the network and obtain the
output and similarly I get X 1 X 2 X 3
and provided what's the function and
appended turns so I have obtained target
and output then I compare these two for
calculating the percentage error to
check the accuracy of the network NMS is
the normalized mean square error with
the form of this so it is mostly
preferred for checking the accuracy of
this data fitting Network and if it is
has a value of less than 0.1 then the
network is considered good then I
plotted a regression plot and the plot
between the target and output so if this
to coincide this means the accuracy of
the network is good in this example I
provided the test data by just randomly
creating any numbers but in real life we
want to providing any random junk data
to the input so but you might do in that
case is juice test data that the MATLAB
has created by choosing this command so
this is the command T adore test and
this is get the indices of the test data
from the input X array that we have
created then would get those test
indices and get the values of those test
inputs and then instead of supplying
this test today I've created you can use
this test division data for the same
things percentage error NMAC that I've
done I have already ran this code and
obtain the output but still let's run
this code again click on run the same
windows as in the previous video open
ups and the training is taking place
this shows the view command that I have
used to view the network that I have
created one hidden layer within your own
three inputs and one output
this is a regression plot and this is
the graph that I obtain for checking the
accuracy you can create this whole
network you have created in the function
by choosing function and in the name of
the network functions you would like to
create now these three shows that if you
provide X 1 X 2 and X a with these
inputs instead of the random integers
and obtain the results of percentage
error and the NMS see what you will see
is that the results are very poor so
what this means that if we supply the
inputs in a particular sequence without
any randomness in in them so the
accuracy diseases so it means that the
training of the neural network that
depends highly on the input data that we
are provided and the amount of input
data the number of samples were here as
well as the accuracy of that data
without the noise and you may sometimes
require to choose more processing input
data processing so you can use map STD
or zx4 so what you do is map STD
provides the processing settings and
then after you are train the network you
just reverse this the output here
obtained using the processing settings
you obtained earlier so you can search
for the map STD and the z-score function
in the MATLAB documentation so the
commands that I have used here can be
obtained seen from by typing net so net
is an the network that we have created
so this shows the various option that we
have name is the name of the network we
have ticket user data we can provide
your custom info number of inputs number
of players number of outputs delays
layer delay feedback the input delay but
there are no delays invaded every
network element sample time bias Connect
means the MATLAB chooses the convention
that the input layer is not considered
as the first layer so the first layer
start from the first freedom layer and
you get a second hidden layer that will
be second layer and the last layer will
be the output here so in this case I
have one hidden layer as first and the
output layer second so bias Connect
means that the person
has a bus connected to it and the second
area the output has a bias connected to
it input connect means that the first
hidden layer is receiving the input from
the input layer but the output is not
receiving the paid connection from the
input layer so it is zero zero means
false layer Connect means the the first
hidden layer is not connected with the
base connection to itself nor it is
receiving the weight connection from the
output so actually it is giving the
weight connection to the output data
which is one for the output layer and
the output is not receiving any
connection from itself an output connect
means the the layer that is giving the
output so hidden they're not giving the
output but the output layer is giving
the output hood that's why it is one
inputs layers and these are just the
arrays for that contains the information
and these are the various functions
these are the function that I've used in
my core like I've use this device
function so I write the net door device
function to divine render you can you
divide indices you can do device block
and etc similarly for divide param a
parameter and the ratios performance
function and others you can click on
each of it to show the MATLAB
documentation for it for checking the
sensitivity of the network like which
input influence the output more like
using the paid connection method or
anything you may require the input
weight or the layer weight values or the
bias values so you can use this command
for obtaining rows and these are the
various methods adapt is used for
changing the value of bait and biases
configured for configuring the network
with the number of inputs and outputs
available
Jensen will for generating the Simulink
model before
initializing vivix for commands the mean
square error similan
is the simulate so it do the same thing
as this command to train I have already
used you have already used and after you
have configured you can unpin figure the
network also by calling the train the
network is configured automatically also
type in Tia and these are the various
parameters that you obtain
ten function but now this is I chose TR
dot test and this is these are the
indices and you supply to the X vector
and to obtain the value of test inputs
and from that you calculate the
percentage error
so let's look how to create a similar
model right the same network so this is
the network in Simulink model we supply
with their constant input and the output
is cocaine in the scope window so this
is the function within your network the
mask you supply the input the network of
processed by with the help of math in
math function and this is the formula
for death after that you go to the layer
you have delays but in this scale from
same fitting you don't have any delays
and this goes through the wave these are
the way that has calculated after
training of the network and this goes
for the dot product so whatever input we
obtain we multiply it with weights and
these are combined together and then
finally bias is added to it and this is
the sigmoid function the sigmoid
activation function this is the formula
for a and then you obtain the output
which goes to the second layer and the
same thing happens here so after that
the processing of inputs or the
processing of the output obtained takes
place and the output is viewed in this
Co Findo
so that's it everyone this is how we
train the data fitting noodle network in
the MATLAB and this is how it actually
script for it and if you like it this
like subscribe and share and stay tuned
for more videos like this thanks for
watching
you
