Running Jupyter Notebooks on Gradient

 In previous posts we have discussed Jupyter Notebooks.

We have also discussed Colab Notebooks, which are Jupyter Notebooks hosted by Google.

Gradient is an alternative to Colab for running Jupyter notebooks on the cloud.  Like Colab, they offer a free tier.  They also have additional paid tiers with added features for professionals.

Let's watch the Welcome to Gradient video for a quick overview of what Gradient is all about.  

Gradient actually has way more features then we are going to use in out HTC 'Getting Started with Deep Learning' course.  But it's fascinating to learn about them, and someday they may come in handy for you.

Here's a link to the Quick Start documents for working with Paperspace Gradient.  There's a table of contents on the left side you can use to move around to different topics of interest.

Again, this document discusses many additional Gradient features we will not use in the HTC Deep Learning course.  You can use this document for your reference, or to better educate yourself about all that Gradient can offer.

Fastai has a specific 'Getting Started with Gradient' tutorial you can access here.  It has some fastai specific info in it. 

We are using fastai in the HTC Deep Learning course, so you should definitely read this tutorial, and then use it to get started using Gradient.

1:  When you create your account, there are a few things you want to do.  You need to choose a container.  So you want to choose the Paperspace + FastAI container (was first one  listed for me).

2:  You then need to choose a machine.  Choose the free GPU option to get started.  You can always change it later in your account settings.

Looks like they have a coupon promo code at the bottom of the tutorial (good until end of 2020) you can use to get a discount if you eventually decide to choose one of the paid options.  

3:  You then need to do some terminal magic to update the fastai library (and it's associated lesson notebooks).

You click New : Terminal to open a new terminal window.

You then need to type (copy/paste) and enter (hit return key) the following terminal commands into the terminal.

pip install fastai fastcore --upgrade

followed by

cd fastbook
git pull

Then you can close the terminal window.

At that point you will have to wait a little bit until your notebook 'provisions' itself and prepares to open.  Once the open button stops blinking and says OPEN, then you can press it and begin your Jupyter notebook adventures.

Remember to feed the troll that lives under the terminal window, or he may put a curse on you.

Tip- If you have an existing google account, you can use that to log into Gradient, simplifying the whole get started process a little bit.  You won't have to worry about the email verification process discussed in the tutorial.

Here's a short tutorial video on Creating a Jupyter Notebook in Gradient.  It runs you through the first 2 steps described above. Remember to select the fastai container, not the one they select in the video.

Here's another getting started tutorial video from a Gradient user that might help you get started with things like the Start buttons and other Gradient interface features shown off in the first part of the video.
He covers some more advanced API features in the later parts of the video that don't really apply to how you are going to use Gradient with fastai (fastai is built on top of PyTorch so you get that as a part of the fastai container).  

Remember that fastai has specific easy to use api features for loading things like the images, so i don't see why you would need to do what he is doing with the API features for moving files around.    But perhaps these persistent storage hints will come in handy at some point.

Getting going with fastai jump start

The purpose of these jumpstart notebooks is to help you get going using fastai on Gradient.  Running deep learning out of the start gate.  No nonsense, get to the point, in the fewest lines of code possible, do stuff.


Popular posts from this blog

Simulating the Universe with Machine Learning

CycleGAN: a GAN architecture for learning unpaired image to image transformations

Pix2Pix: a GAN architecture for image to image transformation