So guys, now we are going to continue our discussion with respect to this particular project.
Now already in our previous video we have actually created three pickle file.
One is the scalar pickle file label encoder gender pickle file and one hot encoder for geography pickle
file.
Right now we will go ahead and train an artificial neural network.
And that is what we are going to see how we are going to train this and all.
We'll be discussing about that okay.
So first of all we will go ahead and import TensorFlow okay.
Since we are going to just use TensorFlow as tf okay.
So tf is an alias which we will be specifically using.
Now, uh, before I go ahead, let me just give you a brief idea, like how does a neural network basically
gets created with the help of TensorFlow Keras?
Okay.
So as I said, uh, with respect to Ann, right now in Ann you have a input layer.
Then you have a hidden layer.
You can have multiple layers like hidden layer, like you can have HL one XL two, any number of hidden
layers.
Right.
But just to give you a basic idea, basic Ann looks like it will be having one input layer.
It can have one hidden layer, two hidden layers.
And finally it has a output layer.
Okay.
When we probably take this entire neural network like a specific Ann, let's say in this input I have
like this hidden layer, I have some three nodes, one more hidden layer, I have two nodes.
And finally I have one output node.
Right.
This neural network here we are going to perform the forward propagation and backward propagation.
So in TensorFlow we basically call it as a sequential sequential model.
Okay.
What do we call an As?
It is nothing, but it is a sequential model, right.
And this sequential model here you will be able to see that we will be doing forward propagation, we
will be doing backward propagation.
And all these nodes will be interconnected.
Right.
This input will be interconnected to this.
Then this will be interconnected to this.
And similarly this will be interconnected to this.
This will be interconnected to this.
Right.
And this will also be interconnected.
And finally you'll be interconnected to the output.
So this is my input.
This is my hidden layer one.
This is my hidden layer two.
All this interconnected lines that you have are nothing.
But these are weights W1W2W3 like W4W5W6.
Like this right.
Now in order to give you a brief idea since I have, let's consider this right.
I have two inputs.
I have three, three, uh, nodes, hidden nodes in this hidden layer.
Right.
So here the number of weights that will be it will be nothing but two cross three weights.
Right.
And two cross three is nothing but six weights.
Why two cross three?
It's very simple.
Two inputs, and it is getting connected to three weights at three hidden, uh, neurons in the hidden
layer.
Right along with this here also you will be having a bias B one.
You'll be adding bias b2 and b3.
So along with this six weights they are three bias in this first hidden layer okay.
In the second hidden layer, uh, again here you have three hidden layer, uh, three hidden neurons.
This is getting connected to two hidden neurons.
So over here, you'll be able to see that the weight matrix will be three cross two.
Right.
So again you will be having one more additional six weights.
Right.
And uh here also bias will be added.
So this will be my before this will be my be five.
So here six weights and two bias will be there.
Okay.
So this is with respect to the hidden layer one.
Hidden layer one.
Sorry, hidden layer two.
And this is with respect to hidden layer one.
And finally you have this output layer here also your weights will be connected.
So here some weights will be there.
So here also how many weights will be there.
Two cross one which is two weights.
Right.
And uh here also one bias will get added.
So one bias.
And after this you can probably apply a sigmoid activation function if it is a classification.
If it is a multi-class classification, you can apply softmax right.
So total number of parameters that you see.
Right.
If I say how many trainable parameters are there.
Trainable parameters are there in this neural network it is very simple.
You just say, hey, six plus three, this is nine, then nine plus six, 15, 15 plus two, 17, 17
plus two, 19, 19 plus one, 20.
So with the help of 20 trainable parameters, we will be doing the forward propagation and backward
propagation.
Now similarly this input is basically defined by the number of inputs that we have in our CSV file or
in our data set.
Right.
In our data set, how many inputs we have in data set, how many inputs we have.
If we have two.
So it will be two.
If we have three, it will be three nodes, right.
If we have four, 11, ten any number of nodes.
So in this way only we will be going and created our Ann which is a sequential network.
Sequential network basically means it will be interconnected, right.
Now there is also one more important point if we really want to just create this hidden neurons.
So in Keras there is a library which is called as dense okay.
There is a class which is called as dense okay.
So let me again repeat what are the key parameters that we will be specifically using.
First, when we start creating our Ann we have to initialize a sequential network okay.
See sequential network.
The second thing is that whenever we need to create a hidden neuron.
Right.
Hidden neuron I'm not talking about hidden layer.
If you need to create a hidden neuron we will specifically using dense okay.
So if I say hey dense I want 64 nodes.
So in that particular hidden layer I will be having 64 hidden neurons.
Okay something like this.
So we will be using dense okay.
Along with this, uh, you know that in every node we apply an activation function, right.
So here we will also be using activation function.
The activation function can be sigmoid.
It can be tan h right.
It can be ReLU.
It can be leaky ReLU right.
It can be many.
Any number of others, right?
But always it is a good idea that in the hidden layer you try to use ReLU.
In the output layer you can use sigmoid or softmax, which I've actually discussed about it.
Now this is my third important parameter.
The fourth parameter that we will be using is something called as optimizer.
Now this optimizer can be any kind of optimizer that we have.
I will show you how you can initialize this particular optimizer.
Also, optimizer is uh, useful in back propagation because these are responsible in updating the weights.
Okay.
Updating the weights.
Very important.
Okay.
And the fifth one that we are specifically going to use is nothing but our loss function.
And our main aim is that what loss function will be using and based on this loss function will be having
a gradient descent and all will try to reduce this.
Okay.
And the sixth and the final thing is something called as metrics.
Usually in the classification problem your metrics is like accuracy.
In our regression problem you have MSE mean squared error, mean absolute error and all are there okay.
So all these things will try to implement and my training information also what I will do my entire
training information I will store the logs in some folder okay.
So that I will be able to use tensor board.
And the main aim of the tensor board library is to display this logs in a way that we will be able to
understand.
Some visualization graphs will be used in order to display it.
Okay.
So these are the steps that we are going to first of all focus.
We are going to just go ahead and create a sequential neural network.
Whenever we really want to create any hidden neurons, this hidden neuron, this hidden neuron or even
even in the input I will be specifically using dense.
Okay.
So all these things we are going to go ahead and uh discuss.
So let me quickly, uh, open this now, I will go back to my code.
Okay.
And, uh, here you will be able to see that I will just go ahead and import TensorFlow okay.
So I'm going to import TensorFlow as tf I told you I'm going to use sequential model.
So how do I import it.
So I will go ahead and say hey from TensorFlow from TensorFlow dot Keras dot models.
We are going to import this sequential model.
Sequential okay from TensorFlow Keras dot model okay.
Similarly I will go ahead and write from TensorFlow dot keras dot.
As I said you whenever I need to create a node it is nothing but using dense.
Okay, dense will be that library that we will be using and this entire thing will be present inside
layers.
Okay.
So I'm just going to import dense.
So this is one more library.
Along with this I will be showing you one very important property we'll discuss about which is called
as TensorFlow Keras dot callbacks.
Okay.
And we're just going to import something called as early stopping.
We'll discuss about this early stopping what exactly it is okay.
And finally we have this tensor board okay.
Now tensor board uh we have implemented this.
And finally I'm also going to import date time because I'm going to use this date time also.
So I have executed or imported all these libraries which we are going to use.
One is sequential, one is dense, one is early stopping and one is TensorBoard.
Okay, now let's go ahead and build our model.
Build our an model okay.
Now to build the an model.
What all things we are specifically going to do.
As I said I'm going to create first of all a sequential model.
So I will go ahead and initialize and let me just go ahead and initialize sequential.
Okay.
Now inside the sequential it is important.
Please try to understand this okay.
Inside the sequential I am going to use some layers dense layers and all.
Okay.
So here uh uh if I go back to my diagram.
Okay, let's go back to my diagram over here.
First of all, let's go ahead and understand how many number of inputs that I have okay.
So first this is my entire sequential model okay.
This is my entire sequential model.
Now inside the sequential model, how many inputs I need to probably consider.
So if I go ahead and see my X train dot shape, and from this, if I just try to find out how many columns
are there, that will actually help us to decide how many inputs will be there, right?
How many inputs will be there?
So I have to probably use this entire inputs.
Okay.
Over here.
And let's say that I will be using the sequential and I'll say, hey, initially I'll take this 11 inputs
and then I will go ahead and create my dense.
I'll use this dense library and create my hidden layer.
Let's say that I'm going to use 64 nodes, any number of nodes in this hidden layer.
Right.
And when I am creating this dense, I will also give my input shape, like how many elements are coming
from this input data.
So let's say from this I, I'm getting this x train dot shape of one.
If I go ahead and write like this, it says that what is the input that is probably coming from my X
train data.
That input will get connected over here.
Okay.
So we are initializing our input over here along with the dense layer.
So this is what we are going to first of all do okay.
So quickly I'll go back over here and now see focus on this okay I need to give my input and my hidden
layer one.
First I'll use this dense, let's say in my hidden layer what I'm going to say hey, we are just going
to use 64 neurons.
I'm just considering.
Hey let's go ahead and use 64 neurons.
Now in all this neuron I also need to apply an activation function.
So I will go ahead and apply an activation function okay.
Now once I apply the activation function I will just go ahead and apply ReLU activation function.
Okay.
It is up to you whatever activation functions that you really want to apply now to this hidden layer,
what will be the input that will be coming.
So here you will be having this particular parameter which is called as input underscore shape.
And this is only for the first hidden layer that you really need to write, because it is getting connected
to some inputs over there, right in the second hidden layer and all.
We don't need to write this input underscore shape, but always for the first hidden layer we need to
write this.
So my input underscore shape will be nothing.
But it will uh, again just go ahead and write something like this.
Right.
So it will be x underscore train dot shape.
Because this shape of one, if I probably consider it is just going to take that particular value.
And it is going to consider that that many number of inputs are there.
So if I just go ahead and execute this over here, what is my X underscore train dot shape of one okay
I'll be okay.
Tuple.
Uh so here it says okay I have to use this.
Uh I have to use this index okay.
So shape of one.
Okay.
So here you can see that there are two L elements okay.
In my X underscore train dot shape of one.
Right now if I'm giving input underscore shape of this value comma blank.
If I just give comma blank like this in a tuple.
So I'm just saying that hey it is a single dimension and it has 12 inputs okay.
And that is how I'm also giving over here as my input shape.
Clear.
Very much simple.
Now this is my first hidden layer.
So I'll write down the comment over here.
First hidden layer.
Uh and it is in uh connected with input layer.
Okay.
Connected with input layer.
This is perfect okay.
Now in my second layer again let's go ahead and use the dense I will use 32 neurons over here.
And I have to just go ahead and apply my activation function.
Now after I apply my activation function, I don't even have to give any input shape over here, because
now we know since we have used sequential, it knows that it will be connected, right?
All these layers will be specifically connected.
Okay.
Now finally you will be also see that I'll go ahead and apply one dense one okay.
And then I will say hey go ahead and apply another activation function.
And the reason I'm saying that another activation function, this is my hidden layer two HL two okay.
And here you will be able to see that this is nothing.
But this is my output layer.
Output layer.
How many outputs I need to find out?
Only one.
Right.
It is a binary output.
Right.
So I'll say hey let's go ahead and use this sigmoid over here Okay.
So once I execute this so this actually becomes my entire model.
Okay.
My entire model over here okay.
So if I go ahead and execute this this is my entire model.
Very simple I guess right now just imagine how many parameters will be there.
So what I've actually done over here, let me just go ahead and talk about it okay.
So here I've created a input layer.
So this is my input layer.
This input layer has uh inputs of 12 inputs.
Right.
12 inputs 12 comma some.
Let's consider 12.
Then I have a hidden layer.
This hidden layer is basically happening having 64 hidden neurons.
Right 64 hidden neurons.
Then I have one more hidden layer.
Which has 32 hidden neurons.
And finally, this is my output layer, which is having one output, right?
One neuron.
And this all will be interconnected.
And this is what we have actually created.
Right.
And now we have to probably do the forward and backward propagation.
Now let me just go back to the code.
Now let's go ahead and write model dot summary.
And with the help of model dot summary you'll be able to see that I'll be able to see how many total
number of parameters are there.
So they are around 2945 parameters.
Okay.
So here uh, you can probably see in my dense, uh, initially you have the 64.
Um, then you have this 32, then you have this one.
Okay.
Parameters.
This is nothing, but it is a combination of all the weights and bias.
And that is the reason the total number of parameters will be two nine, four, five okay.
So this is the entire model.
And I'm actually going to do the forward and backward propagation with respect to this.
Now in order to do the forward and backward propagation we need to compile this model.
So let me just go ahead and write compile the model okay.
Now with respect to the compile the model I'll just go ahead and write model dot compile.
And here I'm just going to use some parameters.
One is optimizer.
Okay.
Right now let's keep it blank I will initialize some optimizer over here.
Then you have loss.
And this loss uh I'm just going to use binary cross entropy.
If it is a multi classification you can use sparse cross entropy okay.
So there is a different different values with respect to multi classification.
You will be seeing a parameter which is called as sparse cross entropy.
Again you can go ahead and check with respect to Keras API.
And here we will also go ahead and use one matrix parameter.
And this will be nothing but it will be accuracy.
It is given in the form of list because you can add multiple values also.
Now uh, quickly, one more thing that I really want to show that over here.
Uh, is this the only way to probably put any values, or can I probably go ahead and use some other
way of applying optimizers and all?
Okay, so, uh, let me just show you one more way.
Okay.
So here I'll say, uh, Opt optimizer is nothing but TensorFlow dot.
Okay.
There is a function which is called as optimizers.
TensorFlow optimizers.
Okay.
Sorry.
TensorFlow.
Keras dot Keras dot optimizer.
Okay.
And here we have something called as Adam optimizer.
I think so it should be working fine.
And let's use my learning underscore rate is equal to 0.01.
Okay.
or okay.
TensorFlow is not defined.
So that is the reason you could not see it okay.
Okay.
So now what we have actually done is that see over here when we go ahead and give one optimizer, let's
say that I want to go ahead and give one optimizer over here.
And the optimizer name is Adam okay.
This is the keyword that we can specifically use again in Keras API documentation.
If you go and see I'm actually applying Adam over here.
Okay.
But this Adam has a fixed learning rate okay.
Over here it has a learning rate.
But you you need to provide your own learning rate.
So what you can do you can just import TensorFlow and you can write hey TensorFlow keras dot optimizer
Adam and not any Adam.
See there are a lot of other optimizers.
Also, let me just show you.
So here I'll go ahead and write optimizers.
Dot Adam.
So instead of using Adam you have adadelta add a factor.
Adagrad Adam, Adam w Adam.
Max I think, uh, most of them I have already discussed.
We have discussed Adam, we have discussed adadelta all these things.
Right?
Adagrad.
Also, we have discussed.
Right.
So let's consider right now we'll just go ahead and use Adam.
And here, uh, there will be a parameter which is called as the learning rate, which we can actually
define.
Okay.
So here I have actually defined 0.01.
Similarly, what you can do is that you can also go ahead and write TensorFlow dot Keras.
And you can also set your uh loss okay losses and uh dot different different losses will be also there
I guess.
Let's see uh see over here you have are binary cross entropy.
Then you have categorical cross entropy.
You can use all these specific losses if you want.
Let's say if I want to directly use binary cross entropy I can also use this okay.
And I can store this in one variable like one loss.
And I can use this particular loss over here.
Like see if I use this opt I'll be using this over here.
Copy and paste it.
Right.
So I'm showing you both the ways how you can actually do it directly.
You can also use this particular keyword, or you can also go ahead and initialize this okay.
So if I go ahead and initialize this so I will be able to see that hey this is my loss which looks like
right.
But uh both these ways.
So what I'll do I'll take this optimizer, I'll put it over here.
And similarly I'll use this particular loss and we'll go ahead and do the compilation.
Okay.
Now when we are doing the compilation this is the compiling the model over here.
So okay.
Uh, there is an error metric.
Uh, please.
Uh, okay, let's see what it says.
Including this, this this this this this metric metric metric metrics.
It should be, uh, something like metrics.
Okay.
So this is the keyword that is used.
So uh, again this kind of error will come.
I'm making sure that I don't delete any of the error okay.
Now the next thing what I will do I will go ahead and set up the TensorBoard because we have still not
started the training.
Right?
We have still not started.
The training and training will be set up, you know, as soon as I probably start training.
Uh, sorry.
This.
Once the training gets completed, we will also be able to, uh, capture that logs and we'll be able
to visualize that logs.
So that is the reason we set up this TensorBoard.
So I'll create a directory which is called as log underscore directory.
And here I will say hey make this folder okay.
So first of all log slash fit I will probably make this folder over here okay.
And I'll say hey go ahead and make this and use some date time.
Use some date time format so that you'll be able to see this.
And then I will go ahead and write date time okay Dot now.
Okay.
I'm using this date time.
And you let me use some time format.
So I will go ahead and write str of time.
And I will just use this particular time format to capture my logs.
Okay.
So let me just copy and paste it over here okay.
So this is my time format that I'm actually going to use okay.
It will basically go ahead and create this entire directory in shot.
Okay.
Now, uh, quickly, uh, let's do one more, uh, thing over here.
Is that, uh, I'm also going to, uh, uh, okay.
For right now, let me just go ahead and create this logs directory.
And, uh, it is going to make sure that whenever we train our model, it will go ahead and it will
store all the logs over here.
Okay.
Perfect.
Uh, till here.
I think everybody is, uh, good enough.
Uh, now, uh, let me do one more thing.
Let me just go ahead and create my TensorFlow callback.
Okay.
So I'm going to probably create this particular variable.
And what is the main aim of this.
We will just go ahead and say hey use this TensorBoard.
What we are trying to import.
Now this TensorBoard we need to import it okay.
So in order to import it I will be importing two libraries.
Since I'm going to import two important things.
One is import tensorflow dot Keras dot calls back okay I'll be talking about what is the importance
of this.
Calls back just in some time.
So I'll go ahead and write hey import early stopping along with this I'm just going to import TensorBoard.
I will talk about both, uh, early stopping and TensorBoard.
But right now you just understand that tensor board is just to visualize all your logs that you have
while training your entire model.
Okay.
You can also do it manually with the help of matplotlib.
But I feel tensor board will be a good one.
Okay, so here I have initialized tensor board.
I'm saying hey, let's give this as my log directory over here.
Log directory is equal to.
I'm just going to give my log directory whichever log directory I've actually created.
The next thing that I will be using is some histogram frequency as one.
To just see that some of the histogram diagrams is also created from here.
Okay.
So once this is done I'll go ahead and execute it.
Invalid syntax.
Okay.
Uh from I have to use over here as from.
Okay.
So perfect.
This works absolutely fine.
Okay.
Now we will also go ahead and set up something called as early stopping.
Now why exactly is this early stopping?
See guys, when we are training a neural network we can train it for any number of epochs.
Okay.
We can train it for multiple epochs.
100 epochs.
You know, we can create different different batch size and we can do forward and backward propagation.
But, uh, you know, it may happen in such a way that even we run for 5 to 6 epochs continuously there.
Let's say I'm trying it to run it for 100 epochs.
Okay.
But if we see such a scenario where in 20 epochs, only my model has trained at this batch level, and
after that it is just varying by 1 or 2%, right?
Then it is not necessary that you need to probably train that particular model for 100 epochs, right?
Uh, whenever we train our model, we have to probably continuously monitor our loss value.
If that loss value is decreasing, then it is fine.
We can train it continuously.
But let's say that after a certain number of epochs, that particular loss value is not decreasing.
So what do we do at that point time.
We don't need to probably run the entire 100 epochs since, uh, what we can do, we can say, hey,
go ahead and apply this early.
Stopping where?
Go ahead and see only the loss value.
If it is not decreasing, let's say for the five epochs itself, then you can stop the training there
itself.
So and that is the reason why we use early stopping.
So here I'm just going to create my early stopping callback okay.
So this is just like a callback that we use.
And here uh we will go ahead and write early stopping.
We will go ahead and monitor one very important parameter while we are training, right, which is called
as validation loss val underscore loss.
I will talk about what all keys is also getting created.
Okay.
Um like you'll be able to see multiple keys.
Uh you'll have validation loss.
You'll have training loss and all.
But right now I'm just going to monitor this validation loss.
And let's say I'm saying hey be patient for at least five epochs, okay.
Before taking that particular decision.
If till the five epochs you see there is no improvement, then you can stop it over there.
Okay.
And then one more parameter that I'm actually going to say hey, it should restore the best weights.
So when you are, uh, going through the forward and the backward propagation which at which epoch,
you find out the best weight, you can probably consider that.
And you can reload it when you stop the early stopping.
Okay.
So I'm just going to use all these parameters and do the early stopping right.
Very important.
So this will be my early stopping that I'll use now finally now this is the stage of training the model
okay I've created my step by step what I've actually done I have created my entire model.
I have said, hey, which, uh, optimizes I'm going to use, which loss I'm going to use and I've,
I've assigned that entire optimizer and loss to my model along with my metrics.
Okay.
Then I'm saying, hey, go ahead and set up the TensorBoard.
Um, you have to probably create all the logs while training.
So this is the logs.
And from this particular logs only we will try to visualize some of the data.
Now here I have created TensorFlow callback.
And here I have actually created Earlystopping callback.
And I've told you what is the importance of early stopping callback.
Now for training the model, I will just go ahead and say, hey, history is equal to nothing but model
dot fit.
Okay.
And here, uh, I'm going to give my X train comma Y train okay.
Comma.
Along with this I'm also going to give my validation underscore data.
Validation on the score data will be the combination of x test.
Comma y test.
Understand this y test data will be used for comparison with respect to the accuracy.
Then I'm going to say hey, run it for 100 epochs.
Let's say I'm saying go ahead and run it for 100 epochs.
And finally I'm also going to apply my callbacks.
So this callbacks is nothing but two callbacks I'm going to apply.
One is TensorFlow callback.
And the other one is specifically my other callback, which I am going to use, which is nothing but
early stopping callback.
Okay, so this two callback I'm going to basically see.
And then uh, after we train this entire model, uh, we will load our entire TensorBoard that I will
show you how it is basically done.
But over here you will be able to see my logs.
File will start getting created.
Okay.
So let's quickly, uh, go ahead and uh, you know, execute this.
And I hope everyone things should work fine.
So I will just go ahead and hit execution.
Now here you can see my epochs has started right.
Initially I'm getting the accuracy over here.
Validation accuracy is over here.
And uh, you can see I told to run it for 100 epochs, but this is just stopped at seven.
Okay, let me do one thing.
Let me increase this patience level to ten.
Okay?
I'm saying, hey, try to just see till ten epochs.
Now let's go ahead and execute it.
So here you can see accuracy is 85 validation.
This one I think we are getting the best validation loss till here okay.
It will wait for the ten.
Now in the 16th 17th epoch, it has stopped, right?
And this is all the values that I get.
I get my loss.
So till 87% I am able to get it.
Validation loss.
I am able to get this much validation accuracy.
I am able to get 0.85 right.
So these are all the information that, uh, you will be seeing over here that we are able to get it
right, which is amazing.
And here you can see that I am able to train the neural network quickly as possible, right?
Uh, let's do one thing.
Let's save this entire model file.
So I will say, hey, go ahead and save this model dot save.
Um, and I'm going to probably create one h5 file.
So h5 file will be compatible with Keras.
So that is the reason I'm actually creating it.
So here you can also see model dot h5 file.
Okay uh let's do one thing.
Let's load.
load TensorBoard extension.
Okay.
So let's load this.
So for loading I will just go ahead and write load uh load underscore extension.
And here I'm just going to use TensorBoard.
Now this extension also we need to install in our uh so here you can see line magic function uh load
underscore extension not found I think the spelling is wrong over here.
I just need to write like this.
So here you can see I have launched my TensorBoard session.
It looks something like this.
Then what I will do, I will just go ahead and say, hey, take this TensorBoard, my magic function.
Okay.
And along with this, use this log directory.
And inside that log directory I have my logs slash fit folder okay.
So this is how you load this entire tensor board.
Now if you see inside this logs this is nothing.
But it has your entire information with respect to training and with respect to validation.
Okay.
And it is just going to load this and it is showing going to show us in this visualized format.
Let's see this.
Okay.
So here, uh, you will be able to see it I think it is getting loaded.
Let's see whether it is getting loaded or not so quickly.
I think it should get loaded.
Yes.
So it says hey uh um.
Mhm.
So it says hey no dashboards are active for the current data.
The problem may be let's go ahead and launch this.
Uh sorry.
Let's go.
Okay.
See what you have to do is that let me click it over here.
Click over here right launch TensorBoard session okay.
Now in this TensorBoard session just click and launch over here.
You'll be able to see use Current Working directory or select another folder.
I will go ahead and select another folder and let me just go ahead and click this.
And let me just go ahead and inside this particular folder.
And let's go ahead and select this train folder okay I will say hey just go ahead and load this train
folder.
Let's see whether it will load or not.
I think it is not able to find out this log fit directory which is already there.
Okay.
That is the problem.
See okay okay I got it now okay.
The problem is what Right.
It is trying to find out this log slash fit folder.
But this is the folder name that I'm actually getting.
So let me just go ahead and write log fit folder okay.
Let's see I think it should uh, replace the name or I can just give that particular folder name over
here, even though if I execute it here, you'll be able to see that I'll not be able to get it because
this is getting renamed.
Okay.
So let me quickly rename this.
So I will say, hey, reveal in the File Explorer.
Uh uh, inside this logs folder, this is the folder name.
And here is my events.
That is the information that is coming up.
Okay.
So quickly, uh, let me do one thing.
Let me rename it from here.
That would be a little bit faster.
I think it will not allow because the file may be getting used somewhere.
Okay, so let me do one thing.
Let me quickly rename this instead of rename.
Right?
I will just go ahead and take this name entirely okay.
And now I will go back over here and say instead of fit you just go ahead and use this entire name,
okay?
So now I think it should be able to load it because I've given the correct loading directory.
See, I'm not going to edit all these things.
Whatever error that I'm actually facing, I will be showing you so that you will be able to execute
it.
Okay.
That is my main aim.
Okay.
I don't know why we have to probably execute two times or it was getting loaded.
Now here you can see.
beautiful.
You are getting all this diagrams see so here based on epoch accuracy.
Let's go ahead and see this.
Let's say I will just uncheck it.
And here I will just go ahead and write epoch accuracy.
Now with respect to this epoch accuracy you will be able to see.
Let me do one thing.
Let me just uncheck this okay.
So this is my epoch accuracy.
This is my epoch loss.
Okay.
Now see with respect to this epoch loss, uh, you'll be able to see my loss is decreasing.
This is good, right?
Uh, if I close this, uh, over here also, you'll be able to see.
Let's go ahead and use this.
An epoch accuracy.
You'll be able to see this graph.
See, it is increasing from 0.855 to 0.8655.
So this is good.
It is going in this direction right.
And uh you can see what relative step, what value, what accuracy you have actually got.
Every information is basically getting stored over here.
You can also change this value with respect to smoothing.
And here you will be able to see how the accuracy changes.
Right.
See these are some of the parameters.
This is also something very important.
Uh, the dense underscore three.
Right.
This, uh, uh, it just looks like, uh, say, uh, if you have seen this histogram, it just looks
like a gradient descent in opposite manner.
Right.
This is the maximum top pick and this is the minimum loss we are able to get right.
Which looks like this over here.
So here also you can probably observe each and every this.
But the main thing is epoch accuracy and epoch loss which you are able to see it over here.
Not only that, uh, let's do one thing.
Let's, uh, instead of taking train, let's go ahead and see validation.
Now in validation you have this epoch accuracy.
Um, so here again there is some up and down, but at least you are able to get it to 0.855.
Um, then you also have this epoch loss, epoch accuracy versus iteration, epoch loss versus iteration.
So please go ahead and check this out.
Uh, entirely.
I've already shown you how to do it.
Uh, first of all, you need to set this entire logs.
Whatever folder name you are probably getting.
You have to probably use that.
Okay.
Um, but still, you need to think why that folder came in that way.
Okay?
Okay.
I was using this plus, right?
Some date sign over here, uh, automatically, with the help of date sign, you could see that, uh,
instead of writing like this, right?
I could have written something like this.
I'll keep this code like this.
Okay.
It will be slash.
And inside that, any date format will be created.
Okay, perfect.
Uh, till here, I think everything looks good, but, uh, always make sure that if I am using this
folder wise over here, let me just show you again.
Please make this change.
So I'm saying, hey, inside the fit folder, you have to probably create every time date, time stamp.
And then you have to probably go ahead and create your logs.
So in this case, uh, you don't even have to use this, right.
You'll be able to get it perfect.
So, uh, this was about this one.
We have also saved the pickle file.
Uh, we have done almost each and every thing.
Uh, and this is how, uh, an neural network is basically created, right?