- Provision IBM Cloud Services
- Create Watson Studio Project / Connect Services
- Add Data
- Build Neural Networks
- Run Experiments
- Predict With Model
Sign into IBM Cloud to see the welcome page below. New services are provisioned by selecting “Catalog.” Search for and select “Watson Studio.”
Make sure that a Lite plan is being selected for all services. Click “Create,” then search for and add Lite “Machine Learning” and “Object Storage” services in the Catalog. Once finished, the IBM Cloud logo in the top left should bring you to a page shown below.
Now a new Watson Studio Project will be created that utilizes all the IBM Cloud services just provisioned. Access Watson Studio by selecting the created Watson Studio service from the IBM Cloud dashboard, then select “Get Started” click through prompts. Once in Watson Studio select “New project” on the right. The type of project needed is “Complete.”
Name the new project “DLaaS Workshop.” The IBM Cloud Object Storage service that was provisioned is already associated with our project. Select “Create” at the bottom right.
Once the new project is created, select “Settings” in the far-right of the top menu. Scroll down until “Associated services” is visible and under “Add service” select “Machine Learning” to add the existing Watson Machine Learning service that was provisioned. Now all over the services are associated with each other in the Watson Studio project and are ready for Deep Learning models.
Buckets will now be created in the IBM Cloud Object storage service to so that the mnist training data and the results of deep learning training algorithms can be stored. The data is loaded in two different formats, demonstrated in “AddMNistData.ipynb”. Under assets, we will add a “New notebook”, chose "From URL," name the notebook "AddMnistData", and to point it to https://raw.githubusercontent.com/PubChimps/DLaaSWorkshop/master/AddMnistData.ipynb as the "Notebook URL" while keeping the default runtime already specified.
To add the mnist data to Cloud Object Storage, press Shift+Enter through the cells of the notebook and observe output |
Two neural networks will be created, a convolutional neural network (cnn) by using Watson Studio’s Neural Network Modeler along with a multilayer perceptron (mlp) in Keras.
The steps to create a cnn using Neural Network Modeler are shown in the following annotated images.
In the “Assets” section of the “DLaaS Workshop” project, scroll and select “New Flow” from “Modeler flows” |
Name the new model “mnist-nnm” and select “Neural Network Modeler” as the flow type. Then select “Create” |
Use the Palette to the left to drag and drop the 10 neural network nodes shown above and connect them as follows. |
Now the nodes must be configured for the mnist data, a node’s settings are visible by double-clicking it or selecting ⋮ then “Open.”
Configure the “Image Data” settings. Images are 28x28, 10 classes and is in Python Pickle format. Select “Save” |
The settings for the “Conv 2D” layer are on the left. The settings that cannot be seen in the screenshot are left to their default. Make sure the Trainable box is checked. Select "Save" |
The “ReLU” activation layer will have a “Negative slope” of 0.3 |
The “Pool 2D” settings. Make sure the Trainable box is checked for this node and the “Conv 2D” node |
The “Dense” node before the softmax classifier must have the same number of nodes as classes in the data, in this case 10. |
All other nodes are left in default settings. The “Validation Success” notification should now be seen. Select “Publish training definition” in the top right. |
Name the training definition “mnist-nnm-training-def” and associate it with the WML instance. Select "Publish" |
Once the training definition is successfully created, “train it in an experiment.” |
Name the experiment “mnist-nnm-experiment” and click “Select” under “Cloud Object Storage…” |
Under the assets section of the “DLaaS Workshop” project, add a new notebook with "From URL" as the source, name it “mnist-hpo” and copy/paste https://raw.githubusercontent.com/PubChimps/DLaaSWorkshop/master/mnist-hpo.ipynb as the Notebook URL. "Default Anaconda S (4vCPU and 16GB RAM) will allow the Keras model to train faster. Select "Create Notebook"
The experiment that was created in the previous section should be done training. Find “mnist-nnm-experiment” under the Experiments section of the “DLaaS Workshop” project.
“mnist-nnm-training-def” should be in the Completed section. Its output logs can be view by selecting it. |
A new experiement will now be added to illustrate Watson Studio’s Hyperparameter Optimization. Select “New experiment” in the assets section of the “DLaaS Workshop,” name the new experiment “mnist-hpo-experiment” and click “Select.”
The buckets that were created in part 2 of “AddMnistData.ipynb” will be used here |
Add a training definition and name it “mnist-hpo-training-def” and upload this zip file. It contains the model written in Keras earlier, as well as other code. |
Instruct Watson Studio to vary the hyperparameter "learning_rate" as follows. Select "Add" |
The experiment is ready. Select "Create" then "Create and run" |
Pick a model to save and select it by clicking ⋮ then "Save Model"
Name the model "mnist-hpo-saved-model". Select "Save" |
Use the saved model in the notebook PredictingWithModel