You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Create Watson Studio Project / Connect Services
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.
Add Data
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
The Notebook will ask for Cloud Object Storage credentials, these can be found be selecting the provisioned service in the IBM Cloud dashboard, then "Service Credentials, then coping "WDP-Admin-..." to clipboard and pasting into notebook
Build Neural Networks
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.
With Neural Network Modeler
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.”
Edit the “Data” section of the "Input Data" node by selecting "Create a Connection", then point to the pickle object that was created and stored in the "mnist-nnm-…" bucket from the AddMnistData Notebook, then select “Settings”
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…”
Select the “mnist-nnm-…” bucket containing training data. Create a new object storage bucket to store results. This has to be a globally unique bucket name, so I added my last name. Click “Select,” then "Add training definition" .
Select an "Existing training definition“ and use the "mnist-nnm-training-def" created earlier. 1 X NVIDIA Tesla K80 (2 GPU)” will be the "Compute plan" (Others are not available on the IBM Cloud Lite plan). Click “Select” and "Create and run." The neural network will now begin training on the mnist data. As it is training continue to the next section.
With Keras
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"
Run Experiments
With Neural Network Modeler
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.
With Hyperparameter Optimization
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.
Choose the "Framework" and "Execution command" illustrated above, the same Compute plan from earlier, and “random” as the Hyperparameter optimization method, fill out the rest of the page as follows before selecting “Add Hyperparameter”
Instruct Watson Studio to vary the hyperparameter "learning_rate" as follows. Select "Add"
The experiment is ready. Select "Create" then "Create and run"
Predict With Model
Pick a model to save and select it by clicking ⋮ then "Save Model"
Name the model "mnist-hpo-saved-model". Select "Save"