In previous session, we just learned the basics of Advancer script, and I explain some of these functions
now let's create another events creep.
This time I want to change the structure of the file and have a more control over neural network.
So I'm going to select all copy them, open a new tab.
Pace and Control is to save your file.
This time I will call it advanced script number two.
Now, let's start from the beginning and see what can we change here.
The first thing that I want you to change here is hidden layer size.
This is only for one hidden layer.
But what if we want to design a network that has more hidden layers like Tree Hill and layers or forehead
and layers in order to do that?
I'm going to remove this tree and inside the bracket I will put one tree in space.
And then for now, let's run your network and see what's the result.
OK, here we can see the structure of our neural network change.
We can see better here.
We have hidden layer number one between neurons.
This is number of neurons that I assign to it.
And for that he didn't layer number two, we have four nerit.
Of course, it has also an output layer.
Now let's just check it here.
We can have more.
For example, if you space and put two here, then run it again, you will have a network with four
different layers, hidden layer and one output layer.
But there is a point here because I'm going to be getting this question of what would be the maximum
number of layers, the hidden layers that we should use.
It will depend on the structure of your data, but in reality, for optimization, for classification
problems.
If you cannot get a good result with maximum of three hidden layers, then don't try for adding an extra
layer.
It won't help you.
So usually we will use only one hidden layer, maybe two or maximum three on this.
That's a deep learning problem and then it's a different thing.
But for optimization problem, for fitting tools, it's going to be enough to or tweet in the years.
Now, let me just remove this one and stay with two hidden layers fitness.
If we select fitness and press EF1 on your keyboard, you can have the help of Matlab with some explanation
about these.
Features it on my keyboard.
I should press F and plus Evren to open this window.
Fitness.
It's a function for fitting neural network.
This is the same tags it means we can use reduced to syntax in this example by default.
It just used the second syntax, which we can define a number of hidden layers and also we can mention
about the training function.
But this has a limited options.
And for example, we cannot change the activation function.
Activation function, for this example is a sigmoid and we can change it here.
Let me open a document for another fitting tools, which is called New F.
Let's check it here.
This is the help window.
New F create a feed for word back propagation network.
Pay attention.
This is absolutely relevant.
2010 onwards, meaning this is a very old feeding tools, but we are going to use it today.
The suggestion is for using a feed forward fee for what is almost the same redefeat net it holds.
So has limited capability and features like we can only change Zahedan size and we can only change the
train function, but we don't have any features to change the other parameters, like an activation
function.
This one is giving you a very good access to change parameters.
For instance, this E for input Paton's this T chosen over target.
This as I choose the size of hidden layers.
There are two syntaxes to use this function.
We can use new F F PTTs, which is for the simple one, and we can also use with more functions and
more features.
Now I'm going to use this one to are more explanation.
You can just read them if you need.
Let me back here and I'm going to change this feed net.
Need new F.
As the syntax mentioned, we need to first define the inputs, my inputs here are X, so I'm going to
put X, then the targets.
I just define the targets as T, x, t.
It might have a different name in your program.
Please pay attention to it.
And then another one, which is the size of my hidden layer, I'm just going to copy and paste it.
That's very real.
Now let's run our program and check it if it's working.
Yeah, very well.
It's working perfectly.
The thing that I'm looking for is to change this activation functions.
As we can see, these are sigmoid and for the output layer is just using the purely.
But what are different activation function that we can use for training a neural net for.
Let's check them here in a comment box.
Let me first query.
You can type help and then transfer.
OK, these are the transfer functions that we can use to train other neural nets for this one is a Campath
competitive transfer function.
We have Hatherly, which is a positive hardly need transfer function if you need to see more information
about each one.
Let me show you, for example, this one.
Just copy it.
And in the health box, look for it here horridly.
We can see some information graph and symbols the syntaxes if you want to use in the description.
And also an example, we can see this is a hard line to transfer function and it's just limited between
negative one, two plus one.
Now, let's check more transfer functions here.
We have a Luksik which is sigmoid to transfer function.
We have Porres mean this one is a positive linear transfer form.
And this is also a good one if you want to use it for an output layer.
Let me just look for you to help us to show you the graph.
Pause, Linda.
This one is basically a linear system, but it will only accept a positive part of the linear system
for the transfer function.
You might need a specific art food that only accept a positive outcome.
That would be a very good fit for it.
And here we have a radio based transfer function.
Look at this one.
This is a rack, bass or radial basis transfer function.
I'll search for it in a health box.
And then I use this one, for instance, to train my network.
In this example, the graph here is like a radial basis transfer function and there are more like a
tank, which is almost the same as the lock sic.
And this one, the three bass is a triangle basis transfer function.
So let me choose the rad bass and tre bass for training my network back to advance a screen window.
I'm going to just define a transfer function here as the three bass for the first layer I have here
two hidden layers, meaning I have a total of three layers and I should define their transfer functions
or activation functions here.
Three bass.
I'm going to choose also this one, the right bass.
Bass for the second there and another one just superiorly was working, Vera puling for the pure linear
for the last one, which is of her output.
Add this t a variable here and run.
Look at this one, the first hidden layer is like a triangle, because I used to bass, the second one
is redBus and the last one is a purely.
But let's see, what about the 15 to what happened?
OK, we can see it's not a very good FT change these transfer functions to maybe a Luksik and 10 for
this one.
Which are basically the same, so let's try it again.
OK, here I have my activation functions and let's take a look at Ft.
It is actually a good fit, so I'm going to keep these two very low.
So by using a new F f more able to change the transfer function and activation function for each hidden
layer.