‫Welcome back.
‫So the last video we made sure that our CoLab notebook runtime or the machine that lives on Google's
‫cloud server that our notebook has been run on is using a GPU to power its computing.
‫Now, I just want to show you something pretty cool about CoLab as well, because these notebooks are
‫shareable, you can run them almost instantaneously.
‫So this is optional video.
‫If you want to just go back into getting our data ready, go skip this one and go into the next video,
‫which we're going to show you an example of a shareable Google CoLab notebook, as well as how much
‫a GPU actually speeds up compute.
‫So if we go to a new tab CoLab Research Google.com, if we were to cancel out of this, the homepage
‫of Google CoLab is actually a notebook in itself.
‫So that's the amazing thing.
‫You can copy that to your Google Drive or we can connect this to a runtime.
‫And now a little bit of extra curriculum would be to go through this notebook here and just get familiar
‫with Google CoLab.
‫Like, there's a lot here, but you just saw that I connected that to a runtime and I can immediately
‫start running code in this notebook.
‫How beautiful is that?
‫So if we go here, this is going to import none.
‫PY map plot lib import py plots plot no set up.
‫I just connected this to a runtime.
‫That is amazing.
‫And now there's a little section in here if we go GPUs and CPUs, TensorFlow with GPUs.
‫So this is what we just did in the last video.
‫In our runtime, we're using a GPU.
‫You can see that if I move, the mouse is going to go away.
‫We're using a GPU on this dog vision notebook, but if we click here, this little guide, this is going
‫to take us to this website here.
‫All detach both of these, by the way, to the resources section.
‫Again, we just connect our runtime up here.
‫This is going to give us a little insight into how fast TensorFlow is with the GPU and without a GPU.
‫So if we go here.
‫Run this cell.
‫It's going to make sure we're using TensorFlow to point something.
‫And this is just a line of code to make sure it's very similar.
‫O GPU not found.
‫Why is this?
‫Let's make sure it is change runtime time.
‫It may be because I'm using a GPU in dog vision.
‫It may be limited to only one.
‫But let's see.
‫Connecting.
‫How beautiful is that?
‫So if we run this says that we've got a GPU.
‫Beautiful.
‫So it's found a GPU at device GPU zero.
‫So if we go here, this is observed speed up on GPU relative to CPU.
‫I'm going to close this table of contents.
‫We don't need that.
‫So we've got a couple of functions here.
‫What this is basically saying is run some code on the CPU and run the same code on the GPU.
‫So there you go with TF device with TF device GPU CPU up there.
‫So let's say shift and anti run this just going to run some sort of loop a number of times.
‫Shouldn't take too long come valve.
‫Oh, there we go.
‫It's going to involve a filter over some random images.
‫So it's processing images.
‫That's exactly what we want to do.
‫Right.
‫Look at that time to involve 32 by seven by seven by three filter over.
‫So this is just basically process some images of this over 100 or so images.
‫Ten times.
‫The CPU took 3.4 seconds.
‫The GPU took 0.1 seconds or just over 0.1 seconds.
‫So 30 times faster.
‫Isn't that beautiful?
‫First of all, the fact how instantly we can connect to using such fast computing in Google CoLab.
‫And second of all, if we use a GPU, we get a speed up of 30 X.
‫I just think that's amazing.
‫And now, again, remember any of these tutorials in Google CoLab?
‫If in doubt, run the code, connect to a runtime and try it out.
‫Run it for yourself.
‫That's the motto, right?
‫If in doubt, run the code.
‫But again, this was just an optional video just to show you the power of Google CoLab and the power
‫of a GPU.
‫Now we know that what a GPU can do.
‫Let's get back into our dog vision notebook and use one.