Well welcome back.
So let's test out our Morty lay out neural network model when one copy this.
I'm gonna come down here and then the first comment is X which is the same as what we had you know what
to lay a neural network so paste this over here the next year's day.
Train y
pace this over here like this.
The argument of the that the third argument is the estimations which we created over here.
Copy this positive here.
Yeah.
You went up to that.
Yes.
Its lending rate
or we can keep the default lending rate and I'm simply going to set a number of iterations to the same
number of iterations we used you know to lay a neural network example.
So I'm going to copy this and then I'm going to paste it over here.
Okay.
And I'm going to store the return parameters in a variable called parameters and then I'm going to bring
this bit that would comment it is the same thing.
So I'm going to copy this then paste it over here and then on comments
right.
Um
we can we can test this out.
Let's see we can test the one by one 0 comment this out the bit that we tested with our own image.
We can do that later.
Let's see what are we have some arrows first.
A comment is out.
So we simply going to run our multilayer and then and then um Yeah let's see.
Control as to save.
Click over here run model.
Okay.
We have an arrow because we failed to say we are using the deplaning library version to cause we import
in the library.
So we've got a change.
We created a new one called V2.
So this has to be V2.
I'm gonna fix this over here.
Let's put it again and see
click over here to run
um we have a typo over here in our library line eleven.
I put an underscore here by mistake.
Oh just fix the
yes the typo should be a plus over here control esta safe.
Okay.
So I run my model again after I fixed the arrow click over here.
Okay.
Good.
It's training now.
Okay.
The arrow is reducing
okay.
We selected two thousand five hundred iterations.
We are almost there.
And the arrow has reduced drastically.
So that's the curve.
It looks better than the one we saw with the.
Ready to lay a neural network the arrow.
We ended up with zero point zero two three six.
Okay.
This does it.
And as you can see this is seventy six percent accuracy for our test set.
Our training set is almost 100 percent.
And this is true too.
This could be due to over fitting something or someone else over fitting which we should look at later.
Um but yeah you can see the improvement here and you can actually play with the hyper parameters we
are trying.
Just uh finally a neural network here.
And finally uh we've decided on a particular number of nodes.
So you have so many hyper parameters that you can change you can change the number of nodes pair layer
you can change the number of layers you want you can change the learning rate you can change a number
of iterations etc. so you can play with that and see how how how far you can get the accuracy.
Okay.
So now um we front a prediction.
Let's see.
We can test the further like we did earlier this is the file for a while.
That was the file for library.
This is our file.
Next what are we going to do is show the wrong predictions like we did earlier how uncommon this bit
control is and then going to run tomorrow.
It's almost complete
okay.
Um these are the wrong ones.
Okay so we mistook this for a cut the second one we saw an actual cut and we weren't able to predict
it.
And these ones where you have the cuts blending into the background it's it's very difficult for the
new network at this stage to be able to accurately predict those.
So these are the the wrong ones that we got we mistook this for a cut with mistook this for a cut as
well and we weren't able to predict the cuts here.
Right.
Let's try with our image.
I'm gonna come over here or come in this
comment.
I'm going to comment this block and this is image number six.
It's in our images folder.
It's not a cut.
Let's see number six.
Number six is this bird over here.
Let's see what prediction we get for it.
So we predicted this if it's a cat we should see one if it is.
If it's not a cat we should see zero.
I'm going to click over here run module okay.
It started
okay.
And um so it's predicted this us not a cat so accuracy is one that is good.
Okay.
So I advise you to try with the other images we have.
You know what.
You may just fold up and also go to the Internet and download other images and pass it through the neural
network and see what prediction we get.
This one has an accuracy of 76 percent as we've seen but this can be improved if you are able to find
the right configuration meaning the right number of layers and the right number of nodes spare layer
the right amount of training time the lending rates et cetera you can get it perhaps up to 80 percent
but later on we shall see convolution or neural networks and the best suited for this type of task and
also you should keep in mind we've trained our model with an extremely small amount of data.
Yeah we had about 200 I think to 100 training examples.
That's too small for this type of task.
But yeah I think yeah you can experiment with it further if you have any questions just send me a message
and if you've got any suggestions as well you can always message me and I'll see you in the next lesson.
Have a nice day.