Getting started with Jupyter Notebooks
In this post we are going to get started in playing around with our own Jupyter Notebook.
You have several different ways in which you can access them, which I covered in a previous post. If you wish to run the Notebook locally, then I recommend the use of the Docker option to reduce the amount of local configuration required.
For the purposes of learning, smaller projects and prototyping then in terms of free options I would recommend the use of either Azure Notebooks or Google Colabolatory.
Azure Notebooks more closely resemble a standard Jupyter Notebooks but not offer GPU support in the free version whereas Google Colabolatory are slighty different in terms of user interface and their kernel support is mainly around Python but they do offer GPU support in their free version.
I will initially be making use of Azure Notebooks whilst looking at concepts and simple examples. In later posts in which the use of a GPU would be of benefit, then I will switch to Google Colabolatory.
Choose your environment
You have a choice now of which environment to use if you wish to follow along with the examples.
I will be making use of Azure Notebooks but feel free to use another option if you wish.
Using Jupyter Notebooks with Azure Notebooks
Accessing Azure Notebooks is simple as navigating the projects page. You will need a Microsoft account to sign in.
You can find a copy of my notebook and follow the examples though here.
Using Jupyter Notebooks with Docker
If you are not aware of Docker or have it installed then please refer to a previous post here for more details.
If you navigate to the Docker Hub and search for Jupyter Notebooks then you will come across multiple results (8,130) at the time of writing.
Your selection of a Docker image will depend upon your ultimate objective; different images will be loaded with different application environments, tools and supporting packages.
I narrowed down my selection to official Jupyter Docker images and you can view this guide to help you choose.
The image chose was jupyter/tensorflow-notebook as this provide access to a Python kernel in addition to the TensorFlow and Keras frameworks that I will be making use of in later posts.
The first step is to download the image from Docker Hub, which we can do by executing the following command:
$ docker pull jupyter/tensorflow-notebook
And once the image has downloaded, we then want to run the container:
$ docker run -p 8888:8888 jupyter/tensorflow-notebook
The container should now start up and you can navigate to the IP address of machine on which the container was started. If you are running on your local machine, then this would be http://127.0.0.1:8888/
This option is also of benefit if you wish to make use of a GPU if your machine happens to have a CUDA enabled GPU. The launch command for Docker is slightly different if you want to start the container with GPU support and you will need to make sure your machine has the latest NVIDIA drivers installed.
You can download a copy of the notebook from my Github page here.