PrimeHub Quickstart
1-Minute PrimeHub Demo
Brief
In this quickstart, we will learn how to use a Notebook to train/generate a simple model. Then, in the follow-up guide, we will learn how to submit a parameter-tuning job for the model tuning from same Notebook.
- Notebook is a fundamental feature of Community/Enterprise editions.
- Jobs is a feature of Enterprise edition.
Training a model on Notebook
What we need?
- The image - infuseai/docker-stacks:tensorflow-notebook-v2-4-1-5b5a244c
- An instance type >= minimal requirement (CPU=1, GPU=0, Mem=2G) 
- The prepared notebook file: - Download my_model.ipynb 
- Choose a group with enabled Shared Volume (a.k.a Group Volume) 
Please have the image, the instance type on PrimeHub or request administrators for the assistance before we start.
Steps
- Enter Notebook from User Portal, select the image, the instance type and start a notebook.

- From File Browser of Notebook, navigate into the directory of - <group_name>which is a Group Volume; here data-team is our working group.
- While inside the group volume, copy/drag the downloaded - my_model.ipynbthere in File Browser and open it.
- Run All Cells, it will save the model file - my_model.h5at the local. 
So far, we have trained and generated a model file via our Notebook. This is achievable in both Community and Enterprise editions of PrimeHub.
The next stage, parameter-tuning job, is for Enterprise users. Keep your Notebook environment open, and let's continue on...
Parameter-tuning Job
What we need?
- The same image as above 
- The same instance type as above 
- API Token 
- The prepared notebook file of the example - Download tune_params.ipynb 
Steps
- While inside the group volume, copy/drag the downloaded - tune_params.ipynband open it.- Click on Cell 4, from Property Inspector, we can see the notebook has set - epochas a- parameter- See Papermill site ⇗ for the detail of Parameterize. 
  
- Back to PrimeHub tab, hover over Profile icon, generate a API Token and copy it.  
- Back to Notebook tab, click - PrimeHubdropdown on the toolbar of the opened notebook, select API Token and paste the generated token here.  
- Click - PrimeHubdropdown again and select- Submit Notebook as Jobthis time.
- Select the instance type and the image; fill in - Job Nametune_params_epoch_tf and - Fill in - Notebook Parameterswith the code below due to- epochis parameterized.- epoch = 2
- Back to PrimeHub tab, enter Jobs and check the job - tune_params_epoch_tfwe submitted. 
- Once the job succeeded, back to Notebook, we can find a notebook - tune_params-<datetime>of output by the job and the overwritten- my_model.h5after tuning. 
We now have walked through a typical flow of training and saving a simple model file, then submitting a job of tuning the generated on Notebook. In a real project, we may want to use various combinations of jobs and notebooks to pipeline repeatable workflows.
What's Next?
As Enterprise users, we desperately want to verify the performance of our model, therefore, we can deploy models as services and query the services with testing data.
