Hello, everyone, and welcome to another amazing session in which we are going to see how to work with
weights and biases and integrated with our already existing TensorFlow code.
Base weights and biases help practitioners in experiment tracking collaborative reports, dataset and
model versioning, Interactive data visualization and hyper parameter optimization is trusted by over
100,000 plus machine learning practitioners around the world.
In this session, we are going to focus on experiment tracking.
It's one thing to build a model, train this model and evaluate it on a given dataset.
And at least as we've seen throughout this course, this is pretty easy with TensorFlow.
But when we work in large teams and we have to collaborate, we have to produce reproducible results,
we need to debug this ML models as a team and we also need to enforce transparency.
Then a machine learning operations platform like weights and biases becomes indispensable weights and
biases.
Parameters build better models faster with experiment tracking that revisioning and model management.
As of now, the different products which weights and biases offers to us our experiments tracking reporting
that is producing collaborative dashboards, artifacts, dataset and model versioning.
Just like how you would do code versioning in Git, our interactive data visualization and hyper parameter
optimization.
Now, also, you could see that this is being used by modern 100,000 machine learning practitioners
around the world.
Some key aspects of this weights and bias tool are the fact that you could integrate very quickly.
You see that with Keras.
So here we suppose, and we are building a Keras model, a TensorFlow Keras model, and that all you
need to do is to impart this one DB call back right here, start a new run as is given your if you have
some configurations, you set that those configurations and then in the place of the callbacks you simply
pass this weights in bias callback which we import it right here.
So it's quite easy to integrate with already existing all frameworks.
Now you see with any framework you just need to do one DB log and you could log any information you
want to log.
We could also visualize useful information very seamlessly and then we could collaborate in real time.
So your if you're working on a project, you could all as part of the team, discuss the project's progression
and see how to eliminate any bugs or any problems.
Now, weights and biases is designed for all use cases.
So here we have a practitioner that's we suppose not just a single person.
You have this dashboard central dashboard you can look at, you see this hyper parameter sweeps artifacts.
Your you could do data set and model versioning just like you would do it.
GitHub code reports to share updates very transparently throughout this course will look at these different
products.
And in this section we'll focus on experiments tracking.
We're now going to go straight forward into signing up.
So we click right here, want to sign up with GitHub, click here, and then we authorize one DB to
get access to our neural learning account.
So authorize one to be we have the full name organization and you will learn and that's fine.
Okay, So I agree to the terms and conditions.
You could always read out the terms and conditions very carefully.
And then from here we also have to put in this username.
So let's say neural learn and okay, so we continue how often do you train models, let's say every
week.
So we have that and then get started.
Here is now homepage.
You could create a new project, you could modify a profile, invite your team, you have this documentation,
you click, write your docs.
The one DB that I with the different guides references which you could always make use of in case you
are having any difficulties or as a starter, you want to master how all of this work.
Then you also have this fully connected right here which brings ML practitioners together.
Now you will have curated tutorials, conversations with industry leaders, deep dives into new ML research
and a whole lot more.
So you would always have this information.
Others curated information at your disposal.
Then we also have the community and then we have this quick stat for the different framework so we could
view all frameworks here.
And getting back, you see, we have PyTorch, Keras, we're working with Keras.
Click on Keras.
You would have this Quickstart for Keras users, which we actually.
So here you see you see how easy it is to get started with one DB in Keras.
The very first step we will take would be to install and log into one DB, so we'll simply copy this
and then get back to our lab notebook.
We paste this all right here and then run this.
So we have the syntax error.
Let's have this and then we run.
There we go.
As you can see, one DB has been installed from here.
We are going to get into the logging.
Now you see, you can find your API key in your browser here, so we could click on this link, get
the API key and then paste it out here.
Now let's get back to this and then copy out this API key.
There we go.
We have that and then we paste it out here.
So we paste it out there.
Or you could click on this link and then still get the key which we can paste in here and then simply
press and enter.
So we hit enter and we should be able to log in since we have this key put in right here.
Now moving on to the next step at the top of your training script, start a new run.
And to start this new one, we are going to make use of this init method.
Getting back to the documentation you have, your run is a unit of computation logged by one DB.
Typically this is an an ML experiment, so we create a run with the one DB in it.
So before moving on, you should note that you could create a project and in this project you have several
runs.
Now one run could be for training, so we could have a training run like some sort of ML experiment
as defined here.
And then we have evaluation and you could have other different runs or all the different training processes
which will act as different runs here.
As you can see, when you just import one DB, the run is known and now you have one DB in it.
Once you have once you make a call with this you on this method, you have a run which is automatically
created.
And so everything you're going to lock in into one DB will be sent to that particular run.
So if you have, say, this project, let's call this project malaria or Prediction project, if you
have our malaria prediction project and then we have this training run everything like once we create
this run, everything we log in will be sent into this particular run right here.
And then if we create another run that's evaluation, run, everything we log in will be stored in this
particular run here.
So getting back here, you see, you could create this run and you could finish or you could stop that
run.
And that's why, yeah, once you have this in it, you've created a run, you stop the run and then
you're normally this should be known that there should be no run going, no run created.
Now, after doing this, you could also create this like here's like one DB that you need.
You could put this in a width block so we have width one db in it as run.
Then you now have all the data to be locked in your such that out of this width block, you have no
run from here.
You could check out on the different attributes and then the information related to this attributes.
Now let's get into this one.
DB Neat one.
DB Neat.
You have this definition with all the different arguments it takes and then you have this information
concerning all these different arguments.
So here we could define like we have this run, which you could create by simply doing want to be in
it.
And then we'll specify the project, specify the entity, I would say neural learn the project, malaria
detection, the configuration.
All information will be needed, let's say for training.
We specify a safe code to permit one DB, save our code by default.
This is actually false.
So by default your code is not going to be saved to one DB.
You could check this out here.
Let's have safe code.
Let's search that, save code, go up and there we go.
So by default, we don't allow this.
And you could flip this behavior by going to settings page.
Now, you could check on all this other arguments.
You have this job type argument to, which is also very, very important.
And this is very useful when you group in runs together into larger.
Erm it's using this group argument right here.
Now that said, let's copy this part of the code and then get back to our notebook.
We will notice that we have this in parts so we would have to finish or put out this imports here.
Let's have this, We have import one to be from one to be cross, import one to be called back.
Let's take this off.
So we put those two here and then we, we run the cell.
That should be fine.
Now that's run.
We scroll down, we have the model, let's run this again and then let's actually get back here and
create this run.
So let's have this here.
So one to be in needs, we're going to specify the project.
We're going to create this.
So this is one DB install logging and install logging and initialization.
So we have that now, as we've said already, this is going to permit us create a run.
So here let's have malaria detection, malaria detection and one way the like to write this out like
the preferred to put this hyphen instead of the space.
So let's have that that way.
So we have here malaria detection entity in your learn and let's have that for now.
So let's run the cell and then let's add this code below.
We're currently locked in this new learn and that's fine from here.
Let's now do one TB the run and see what we get from here.
We see that we have no metrics locked yet, so that's fine.
We could now take this off and then go straight away to add our one DB callback to TensorFlow.
Before that we have saved model inputs and hyper parameters.
So one TB config, let's have this copied and then we have that before defining the model, just copy
that and then just here we'll add this code cell again.
And then let's have your initialization configuration and there we go.
Okay, so we have that when the B config learning rate specified number of epochs batch size would include
the dropout rate, the image size, regularization rate, number of filters can all size, number of
strides, pool size number of outputs for the first dense layer number of outputs for the second dense
layer was as fine.
We now around the cell.
So we've now started this configurations.
Then the next and last step is to simply have this callback in this fit method.
So let's copy this out and then get back.
So we have that.
We've run our model.
Let's be sure we run this model and just here, let's have this configuration.
Let's say we have our configuration configuration equal one TB dot config, and then right here we have
configuration and in size and we have same for the other hyper parameters like the dropout rate, regularization
rate, number of filters, kernel size, pool size and number of strides.
We now go ahead to the training process and so we copy this out and paste just right here.
So here would have this callbacks.
Let's take this off instead of this TensorFlow tensor board callback we had, we now have this one DB
callback, so we have this one to be callback and you could always even include the tensor board callback.
So you could also have the tensor board callback we had previously.
Now there we go, we have this one DB callback, let's have that.
And then we run the self metrics.
We compile the model.
One of the models compiled.
Let's include this learning rate.
So let's have this configuration and then we'll specify the learning rates.
So we have that learning right there and then we compile the model and start with the training.
Now the training is complete.
We could go to our weights and bias dashboard right here and see exactly what went on during the training
process.
So here we have this projects.
You could see your neural learn.
We have the projects, we click on this malaria prediction project and then we select this run, the
run we select and here is this sandy water run.
So there we go.
Now you see we have 19 different charts.
AUC validation, LOS false, positive, false positive.
Well, this is Epoc versus Epoc.
So that's why you have this kind of straight line and then you have this precision recall.
Loss through negative.
To positive accuracy.
In fact, all this is basically gardened from all this metrics we had here.
So this means that with this simple callback we have put right here, waiting by us is able to get all
this or capture all of this information during the training process and give it to us or presented to
us after we're done with the training.
So here we can see those different charts.
We've already used to seeing this already, so you should be already familiar with this different charts.
Now, apart from this charts, you have the system information.
So here we have the CPU utilization, we have the system memory utilization process, memory and use
process, memory and use.
While this is in megabytes.
Yeah, we have this information in the percentage with respect to the total memory available.
Then we have process memory available process CPU tracks and use disk utilization network traffic,
GPU utilization, GPU temperature.
So you could have this information, your GPU time spent, GPU memory allocated, GPU power usage.
And so you see how easy it is to get all this system information without writing any extra line of code.
Now from here we could go on to the model.
You see, we have this table right here which shows our model.
It's kind of similar to the model summary we had put out previously.
So yeah, it's kind of similar to what we had here.
So now we have instead of that, we have this beautiful table right here, output shape, number of
parameters type and the name.
So that's it.
And then from here we have this logs.
So we have everything that was locked out like all we had here.
So you see everything locked out.
We have it in this run.
Now recall that when the when doing this one DB in need last year, once we do this one to be in need,
we actually create a run.
And once the run is created, everything we do after that is going to be stored in that run.
And that's why, if you notice here, like you don't only have this information like not only this training
information, but even this data which was locked, even this model because we ran this several times.
So you see here that even this information which was locked is actually start by one DB.
And so you see that experiment tracking here is done very easily and actually seamlessly.
Now you look at the files we start, you have the model best see, you have automatically this Keras
model file will just start.
You have this metadata, you could open this up and you have this information start.
You see that we're using a Tesla P 100 GPU.
So that's it, Python version, operating system version.
And then other information like the GPU count or CPU count and so on and so forth.
So that's it.
Let's get back to this overview.
You see it's still running.
That's because we have our lab notebook still running right here.
Now, one thing you could always count on is this documentation right here.
So you just come straight to those integration and then you pick out Keras, you would have your cursor,
and then you have this one to be Keras one DB callback.
Then right here you have this.
Now you could see these arguments, all the different arguments we have here, and you have the explicit
definitions here.
So let's check out on these arguments.
You see, we have monitor the validation loss, which plays a similar role to this model checkpoint
callback right here.
And also we could specify the mode.
So let's get back to the documentation where we are.
Okay, So we get back to this mode so you could pick out the mode by default.
It's automatic.
We could also select mean or max.
In the case of validation loss, obviously we would select a mean and the case of if we are dealing
with a validation, accuracy or validation position or recall, then we'll select the mode to max such
that we're saving our model when we have the maximum precision or maximum recall.
For example, here we have the safe model save graph, save weights only lock weights, gradients,
training data, validation data.
Now you should know that with this we're able to pass in our data set to when TB and the fact that we
pass in this data to one DB.
And permit us come up with some visualizations of what the model is predicting since now we have the
data.
Then we also have the generator validation steps, levels, predictions, input type and so on and so
forth.
So you could always check out on this.
Now the next thing we'll be doing is take the validation data pass into this one DB callback right here
and then be able to visualize the different predictions as we go through the training process.
So let's break this up a little.
We have this training and validation number of epochs.
This should actually be configuration configuration, number of epochs, number of epochs.
Okay.
So we have that and then we have the verbosity callbacks.
Now in this one to be callback right here, we have validation validation data, which is of our data
set.
And then from here, let's check out the documentation and then we have the labels and the data type.
So let's specify the labels from here.
We have labels and the levels we have here we have Parasitized and Uninfected.
Anyway, we could create this, like we could have the classes, so we could have your labels and then
specify this.
So let's just take this off from your cut that and then piece it out your.
So we have that and then let's have this levels.
Now we have the label.
We could also specify the data type.
So that's how we specify this to be image.
Okay, we have that number of epochs and all of that.
Let's go ahead and modify this number of books here.
So number of epochs, 100.
Let's change this.
Let's just have three epochs for now.
So let's get back.
Want to be config, We should have this up here.
So once we make this, we get this new configuration.
So we run.
That looks fine.
We get back to the training from here.
Now we could run this training again.
Training complete.
Let's go ahead and check out what has been locked in our dashboard.
So let's have this here.
We pick out this run.
There we go.
We see we have still our 19 different charts.
And then we have this media which has been added here.
We click on this and you see what we get.
As we could see here, we have the different images and the predictions.
You could view full screen mode by doing this.
And then just here you could select the step.
So if you pull this to the end, you see we have 36 steps, meaning we have trained for over 36 different
epochs now selecting this malaria detection project and having all this to read different runs right
here.
You see, you could view all the runs simultaneously.
So I could click on this one.
You have this is one run, actually, this is another run.
So I could view all this now simultaneously right here.
See we have that.
You see the difference in our GPU power usage with the two different runs.
That's the sandy water to run and this exalted night to run.
And then from here, if you want to stop around us, if we want to stop this current exalted night we
run, what we could do is come right here.
That is, let's say we let's have this code here.
We could come right here and just simply put out one DB dot finish.
So we call this and we should be able to stop this.
The current run, you can always check out on this one to be the run documentation right here to get
more information about this.
You see for this example, given where the create the run and then the stop the run and then this shows
that there is no current run.
And then after creating the recreating the run, you see that there is now a run.
So this is simply how we stop this run.
And that's what we've just done here.
We could simply run the cell and after running the cell, you have this run summary, you see the accuracy
and the other different metrics and lost values.
Notice how the different metrics and losses have been put out in this command line formatting.
So you could see how those loss, for example, your drops.
And then getting back to our dashboard, we see that there is no current run.
Then we've again recreated a new run with a want to be neat right here.
So we've created this new run on this elevator.
We could check it out here.
You see, we created this new run and you can see this little green cycle right here.
Coming back to another book.
We have this one DB callback, which will give you so far in logging information into weights and biases.
But then this is limited because we are not yet able to define our own custom callbacks.
Now, that said, let's get back to this callbacks.
We are defined here.
Yeah, we have this log images callback.
We're going to actually try to log images into weights and biases using this callback which we had created.
Now recall that to create this kind of custom callbacks you inherit from the callback class in TensorFlow,
and then you get to put in some code in here which defines that custom callback.
Now, we've just copied this and paste it right here.
But the difference here is this is one DB, so this is what we had for Tensor Bard and this one now
for one to be.
You're going to see how easy it is even though we're building this custom callbacks.
So right here.
So let's suppose we want to predict or rather we want to log this conversion matrices and want to log
this to weights and biases.
Now what we'll do is we are going to take off all this year.
So let's get back.
This is what we did with ten so bored we saw that we had to make use of map plot, leap and then log
this information into tensor board.
But here's what we have or what we need to do to log the conversion metrics is simply just this part,
this code right here.
So here's what we have is we'll take all this off.
You see, we take all this code, write your off, take this off.
Oh, let's have that.
So we have this code right here.
Take an off.
And then we just left with this.
So we see that instead of having to write all this code, all we need now to write is just this one.
Now, if you're wondering why or how to get the auto plots or what other plots we could get automatically
like this with weights and bias, we get into these weights and bias GitHub repository, and here we
have we have this link or one DB client tree master, one DB plot.
You see all the different plots we have now.
And since it's constantly under development, surely in some time to come we will have many more of
these different plots we could do very easily.
So here we have bar the pie confusion matrix.
You see we have the convention matrix, histogram, line lion series, precision recall curve, rosy
curve, and Qatar pie pie.
So this means that already we could plot out this coefficient matrix and the RC curve very easily with
Wilson bias.
So let's get back to this or check this out.
The first thing we have noticed, this log one to be the log.
So whenever you're using this one DB callback here was actually happen.
Or what happens under the hood is this information has been logged like this.
So we have make use of this one to be logged.
And then here we are going to have let's change this, let's say confusion, confusion matrix, and
we'll just write like this.
Okay, Yeah, we have the convention matrix and then you have one DB plot confusion matrix.
You could modify this and put power curve that expression we recall curve or RC curve and that's it.
And then this props.
Then we have y true projects, the predictions and then the class names.
So your we should change this class names and have parasitized parasitized.
And what we have here we have uninfected and then you can either pass the probabilities or the predicted
score.
So here we are going to have props equal predicted since what our model predicts or what our model outputs
are the probabilities and then the Y true is equal levels.
From here we're going to take out the spreads because we've done that already.
So let's have this year.
There we go.
This doesn't take into consideration the threshold.
So we take off this threshold that it now we have this callback one DB and then we're ready to train
our model.
After the training process, we have this results which look great, and we could now go ahead to look
at the convention matrix plotted in the dashboard.
So let's get to our dashboard and this is where we should have, let's get back to runs and then click
on this call and run.
And this is what we get now.
We see that we have this coefficient matrix which doesn't actually show us what we expect to get.
And this is simply because the way this was conceived or the way this callback here, this login was
conceived, was such that we have a multi class problem.
So even in the case where we have a binary classification problem, like in this case we expect to have
an output of two values.
So that's why when you have this output, let's get down here, let's click on this, let's add this
code.
So that's why when you have a value like say and the output 0.9, it's considered to be parasitized,
although we defined already, that parasitized is meant to be zero and infected equal one.
And so when we have 0.9, this is greater than the midpoint of this tool, which is 0.5.
So we should consider this as uninfected.
But the way, as we said already, the way this has been conceived is such that even in the binary classification
problem, we shouldn't or we don't have a single output, but two outputs, that is, if we have a value
of 0.9, what one DB expects to see something like this, something like zero and 0.9.
So showing that your oh, let's, let's have input zero one even zero points less than 0.8 and 0.2.
Okay, so let's have this.
So even in this case it comes back to the same output.
So this simply means that we are having an unaffected.
So since this first index here has a higher value.
Now, to solve this issue, what we're going to do is we are going to take each and every output we
have and convert it to this format.
So in the case where we have, for example, 0.1 as output, we are going to convert it into one zero
because this means that the higher the this one means that it's parasitized cell and this tool means
the same because here we're seeing that this zero index, which is the prioritized index, has a higher
value.
Hence this is a prioritized cell.
So that said, what we're going to do now is for all values, less than 0.5, we could say less than
0.5, we are going to convert it into zero.
Sorry, we're going to convert this one zero.
And then for all values greater than 0.5, we're going to convert them into zero one.
So this the transformation we are going to make in order for this one to be locked method to correctly
log our values.
But note that if we're having a multi classification problem, it will be needless doing this transformation.
So let's get straight away and see how we're going to transform this into this required format right
here.
Let's.
Started by copying out this first part.
Let's copy this into this other cell here.
And once we run this, we have this output right here.
Then we could go ahead and modify this predicted.
So what we now have is we will define the spread, this auto list and then four iron range range, the
line of predicted.
We are going to make sure that if the value pre that I we're going to take this zero index.
If it's less than 0.5, then what we have to do is append this to this list spread right here.
So what we're going to append this one zero because this is less than 0.5.
So if it was a multiclass problem, we would have the highest or the higher value in this case, since
we just have in two classes, we have the higher value representing this output which was predicted,
which happens to be less than 0.5.
So we have your one and then yeah, we'll have else.
Brad append what do we have next?
We have zero one.
So yeah, we have zero one.
Let's take this off zero one and that's fine.
So yeah, we've modified the spread and then we could then print out the spread.
So with this now we should be able to have the expected output.
There we go.
We have this output, let's add this code cell and then print out our plate shape.
We run this and what do we get?
You see, we have exactly what we expect.
So that said, let's copy out this part from your and then we're going to add this here.
So we have the spread.
Now let's have this forward and then we're going to have Brad equal input array of print.
So we'll convert it into a non pi array before passing into this lock method console.
That should be fine.
Okay, so that's it.
Now we have this set.
Everything looks fine.
Let's take this off and have that spread.
So we have the spread now everything looks okay and we could now rerun our restart our training.
So let's have this year, let's take this off from here.
We train again for just about two epochs and then the results we get so we can click on this run here.
And then you could have the tables and the custom chats.
Let's start with the custom chats.
You could expand this this way.
So you see that we have the predicted and the actual so we have the model.
You see now that we have this number of true, let's say true positives, which increases the number
of true negatives, which also increase while we have this number of false negatives to be 112, while
here we have 62.
This is 1278 1305.
And when you compare this with this previous run, you see that now we are having reasonable outputs.
As with this previous run, we had that error where the coefficient matrix method of one db considers
all the outputs to be parasitized.
Let's have this back and take this off.
Then from here we could go ahead to look at how to plot the rosy plots.
Let's get back here.
Scroll up.
What we'll do is here we just have to let's commend this here and then now do the same for the row plots.
Let's get back to the GitHub repo and click on this rosy curve here.
In this year, we have now those arguments which have been described.
So here we have why true why probabilities.
Obviously this is the level predicted and then the classes, the class names, classes to plot that
is a set of classes which we are going to plot.
We're going to exclude all classes which aren't specified in this classes to plot argument.
Now this is actually optional, so you don't necessarily need to have this.
We also have this title, so let's copy this out.
Let's copy out this year.
Let's copy this out and paste just right here.
We then specify the levels.
Y True levels.
Yeah, we have Pred and then right here we have this class names.
So let's copy this out and paste here.
Okay, so that's what we have.
Let's run this cell.
Everything looks fine and then restore.
With the training.
Training now complete.
Here are the results we obtain.
We get back to our dashboard and this is what we have.
You could go back to the runs and you'll see that you click on this custom charts right here.
Now let's click on this.
Run your first, and then we have this two custom charts.
So we have those previous conviction metrics which we logged in, and then now we have this ROIC curve,
which we just plotted out.
We could also check out the tables for the C curve and the conviction metrics.
So here we go.
We have this rosy plot and then we have this those two plots here where one is for the uninfected and
the other is for the parasitized class.
I haven't seen how to plot the coefficient metrics and the rosy curve we could check out in the documentation
and look at the order plots.
So here we have basic charts, line scatter bar chart, histogram, model line, and the next model
evaluation charts like what we've just done, the conversion metrics I see curves, PR curves, that's
precision recall curves.
You have them your interactive custom charts, plot leap and plot plot.
So this means you could actually come up with your own plot with map plot lib, and then log that to
one DB.
And then apart from this method in which we use the one DB callback here, Oh no, not this one, the
one that we call callback we had defined previously.
Apart from using that one DB callback to log the loss metrics and other information, we could directly
just do one DB log and then we say for example, want to log the loss?
So we just put our loss.
And then since we got the loss from this logs, we have this logs here, we scroll down and then we
put out your logs logs and then we specify the loss.
So this all what suffices to log this lost values from here.
You could also log the accuracy and all the metrics.
It's actually a dictionary.
So let's have that.
And there we go.
So we've seen how to log these values.
Now, let's also see how the log images, like with this, we had this image and then we log this to
ten.
So board now we'll see how to get this image and then log it to one DB to log Those images will then
check out here in the documentation and you'll see that you can log rich media files.
That's really any kind of major file, three rd point clouds, molecules, HTML and histograms.
So that's that.
You scroll down and you have this code here which permits us log image data.
So yes, logging erases images, log in pill images, log in, images from files, image overlays,
segmentation masks, bounding boxes and so on and so forth.
So you have this.
You also have this histograms.
You have three D visualizations.
So you could see point cloud and molecules.
So you see that one DB actually permits just any practitioner be able to log any data or any kind of
data they really want to log, hence making them more efficient.
So that said, let's get back to this year.
We log in arrays, let's copy this out, let's click here, you click, just simply copy that way and
then you get back to the code.
So here's what we're saying is we want to log we want to be able to log this images as this level.
So let's paste this out somewhere here and then copy out this part.
Again, we're going to copy this part.
Recall that with this one to we are defined here, We we kind of like got we ended at this level where
we got the labels and the predicted and automatically we got this rosy curve and coefficient metrics.
Now what we want to do is get right up to this point where we actually have the image that is our own
image which we've created.
And then from this image, log E to one to B, And so right here we have this piece of code here and
we're going to integrate this one thing we could do again, let's copy this again.
Now let's copy this other one, because here we have the image, so we'll copy this.
Again, we consider that this is 4/10 of board.
Let's write your ten.
So bar ten.
So board.
Okay, we have that for tensor board.
We have this for one DB now one DB plot.
And then this next one is just one DB.
Let's add this here.
There we go.
Okay, so yeah, we have this 1db, that's fine.
So what we're saying is we are going to take off all this here.
So we.
All this off, and then we copy this out.
Oh, let's cut that out and then paste it here.
So there's how are we're going to lock this to one to be as usual, is going to always be simpler than
what we have with the tensor board.
So we just all we need to do is just to take our image and then lock as simple as that.
Now, our image array here, let's have let's see this image array, our image arrays, this output,
which we have, and then we pass this image array into this caption.
Let's put a caption, let's say confusion, confusion matrix for epoch, and then we get the epoch from
here, like we have this epoch.
So we're going to be logging this completion matrix for each and every epoch.
So we just put out this epoch here and that's fine.
So that's our caption.
We have one tab image and we lock it in here.
Let's have this, let's say confusion, confusion matrix or yeah, confusion matrix.
Okay, let's have that.
Now we run this, we copy.
Anyway, we had that already.
Let's copy this out.
We have an error here.
They should be closed.
Okay, so that's fine.
We have this one DB log right here and everything looks okay.
Okay, so let's run that again and check this out.
Looks fine.
Now, we could go ahead and start with a training.
Let's run this.
They should be okay now and compile the model.
After compiling the model, we now go ahead and train the model.
Let's say we want to have three here.
Let's keep that aside for now.
And then here we have this.
Let's paste it out.
It should be the same.
Okay.
Yeah, we have it now.
Let's run the training process and see what we get.
Training now complete.
We can get back to our dashboard and see what we have as plots.
We'll click on this here, this run our car and run.
We have this media we locked previously.
Now let's check in this hidden panels and see what we get.
And it happens that we have this confusion matrix locked in hidden panels.
Anyways, we have that.
And what do you notice?
You see for the three different epochs, you see for the three, you could go to the second and the
third epoch.
Start with the first.
You see we have the condition matrices which should be logged per epoch.
And now let's do this so it appears clearer and we see we have this number of true positives, true
negatives, false positives, false negatives and so on and so forth.
So that's it.
From here you can notice how this value gives some leaves from 68 to 52.
And then finally we have 53.
Now another interesting functionality is you could simply have that C, you could download it and now
you have this full screen and you see that clarity.
So let's press escape close and then get back.
So that's it.
That's how we lock this image very easily with one.
DB.
Now getting back to the documentation, you might have noticed that you have your Keras and then you
have TensorFlow.
Somewhere around you have TensorFlow.
You see that this kind of like considered to be two separate libraries.
But then just note that if you build an Keras model, that's if you're building this kind of model where
you have you're making use of this method, this feed method to train your model.
Then making use of this Keras documentation right here is appropriate, but then sometimes you want
to have control of full control over what you're doing, and then you want to be able to do custom training
like we had seen previously.
Let's scroll down to cause some training loop.
So if you are having a custom training loop, like with this year, you would find that you would not
be able to use the one DB callback as easily as you had done with the Keras code.
So in that case you'll see that instead of having like for example, like year we have training block
and then we have this last year, all you need to do is come and put in the one DB you log and then
you log the loss.
So you just say loss and then you simply lock this last, let's say last non pi and that's all.
So that's why it takes now to log this last values, the different metrics and so on and so forth.
The integration with tensor board has been made quite easy too.
So if you're already using tensor board, it's easy to integrate with one DB.
Now you're they say how one DB is different from tensor barred the ability to reproduce models, automatic
organization fast flexible integration persistence centralized dashboard powerful tables and tools for.
Collaboration that said, let's copy this out, let's copy this again.
And now when we'll be creating our run with a init method, we're going to instead have this.
So let's get back to our code.
Let's reduce this year and then stop this run.
So we have this one DB finish.
We stopped the run, the run stopped, and then we're going to create this other new run which would
take into consideration tens of barred logs.
So let's get back to the top and just write your pieces out.
We've already had this so we could take this off.
Now let's comment this and then let's have Project Entity.
Just copy that and paste out here.
That's fine configuration.
We have that syntax of BAH, that's fine.
Okay, let's run this.
Now we get this error, so let's take this off here.
Now, this isn't compatible with version two of TensorFlow, which is what we're using.
So let's run this again.
And this now should be fine.
We now have created this new run.
Let's scroll down and we get to our custom training loop.
So we're going to run this.
We have the optimizer metric metric validation hyperx number specified.
And then let's say we have this configuration and then we have an E box and epochs.
Okay, so that's it.
We have all this set and then we run this.
We've seen this already under the Section ten, so we get this one in when using several event log directories
like what we're doing right here, please call tensor when db tensor board patch and then specify the
root log directory before the one to be in need.
So let's take this from here.
Copy this out.
And even if we're checking the documentation, you should have that.
So here you have this.
You're the one to be one to be ten support patch, and then you have this root directory right here.
So this means again, we are going to stop the current run.
Where are we exactly?
Let's stop this current run.
It should be at the level of training.
We're going to stop this current run here.
We run this again.
We stop that run.
And then what we do now is we have this year and then we specify logs.
So we have that root directory specified.
Now we have the root directory specified that's logs, get back documentation, we have that specified
before the init.
So we have to run that before the init looks fine.
Let's run this now.
Let's run this cell.
And there we go.
Yeah, we told tensor board already patched.
Remove the symptoms about true from one to be needs.
So since we've already done this patch we should remove this from want to be in needs OC.
Let's take that off and run again.
We're still getting the error.
So what we'll do is we just get back and then have that and then we just go as we started initially.
So let's run this.
They should work now from here we are going to continue with what we were about to do with the custom
training process.
So let's scroll down.
Okay.
So we are going to this point.
We have to anyway, we run this already, so that's fine.
Now let's command this one and then run the cells, run this neural and method, and then start the
training process.
As you can see the training now complete.
Let's go ahead and launch Tensor board.
We have the last values and accuracy values which have been locked in.
You could see them here just reduce this validation, accuracy and validation loss.
Now, from this, we now going to look at our one DB logs.
So we click on this run and you see we have this log data in your you see we have the train, we have
the plot for the loss, we have the plot for the accuracy and we have the plot for the global step.
Then for the validation.
You see, we have this here, we have the global stab validation, loss and validation.
Accuracy is actually what we have with tensor board without adding any extra line of code for the one
DB.
That is the only thing we actually did was at this point here, at this point here we said we wanted
to sync tensor board.
So this all we need to sync tensor support with one DB.
So if you have been using tensor board or if you are using tensor bar on a particular project, that's
all you need to log your information now to one to be apart from this you'll.
Notice this tensile board here, so you can click on that.
We're spinning up your pencil, for instance.
Hang tight, take about 30 seconds and we'll keep it on line as long before even completing the sentence.
You have this already.
So you see, we have the stencil bar, which has been locked.
Here we have the spy torture profiler.
And then time series killers.
Just exactly what we have with ten so bored.
So that sounds cool.
We have the locks, we have the different files which have been saved.
System information.
And we have this charts and then overview where we could see all this information and then get back
to our runs.
So that's it.
We've seen how to sync Tensor bar with one to B, and so now you're ready to track your experiments
with one to be.
Thank you for getting round up to this point and see you next time.