How to use Jupyter Notebook via JupyterHub

QNAP now provides a groundbreaking AI computing platform based on QNAP NAS called QuAI (pronounced "Q A I" ) - QNAP's AI Developer Package.
Data Mining/Machine Learning/Deep Learning
Post Reply
New here
Posts: 9
Joined: Mon Jun 25, 2018 4:16 pm

How to use Jupyter Notebook via JupyterHub

Post by SunnyYou » Tue Aug 14, 2018 6:07 pm

For complete figure version, please visit :)

In this tutorial, you will learn how to use Jupyter Notebook via JupyterHub, and run an example code.

Step 1: Install JupyterHub and open the Notebook server

    JupyterHub can be installed from the QTS App Center.

    Launch and log in to JupyterHub.

    Click the switch from Off to “On” to start the Notebook server.

    The interface will appear as following:
      “Running”: Check started instances
      “Upload”: Upload local files to the server
      “New”: Open a new Notebook, terminal or folder
      “Admin”: Switch to the admin page (administrator accounts only)
      Sign out of Jupyter Notebook

    If a Notebook is running, click “Running” to view the following page. You can also click “Shutdown” to close it.

    Administrators can enter the “”Admin” page and access a user’s Notebook.

Step 2: Run example code

    Choose “Jupyter_example” on the list.

    Open “example.ipynb”.

    A Python example code will be opened on a new Notebook.
    This program can train a Convolutional Neural Network via Keras, which is a high-level neural networks API, for handwritten digit recognition in MNIST dataset.
    For more information, visit:

    The example code has been executed and saved. You can also run it again.
      Click “Run” to execute a specific section or run it sequentially.

      Click “Cell” and choose “Run All” to execute complete code.

      For more Notebook tutorials, visit

    The program does the following:
      At the beginning, required libraries are imported.

        Import Keras libraries
        Import other Python libraries

      Load MNIST dataset: Randomly pick and check an image-label pair

      Preprocess the training set: Reshape and normalize training images / One-hot encode training labels

      Create a Sequential Model layer by layer

      Use the Adam optimizer and choose categorical cross entropy as the objective function to train the model. The following part runs for a few seconds.

      Evaluate the model using the test set. Although the accuracy on training set is higher than 99%, the accuracy on the test set may slightly decrease.

      Finally the testing results are displayed.

Post Reply

Return to “QuAI”