Page 23 - MSDN Magazine, March 2018
P. 23

Figure 2 Getting the SSH Connection Information for the DSVM image has the xcfe4 desktop environment already installed, and
you created a local user account when provisioning the VM. All that’s left to do now is configure the remote desktop service to listen for incoming Remote Desktop Protocol (RDP) connections. To do this, you’ll need to enable xrdp, an open source RDP server that works with xfce.
All this configuration activity on the Ubuntu CLI may seem superfluous for a column about artificial intelligence, but bear in mind that many tools in this space assume a basic familiarity with Linux and the Bash command-line shell.
To install xrdp on the Ubuntu DSVM, you must connect to it via an SSH service, which on Windows often requires a terminal program like PuTTY (putty.org). If your PC is running Windows 10 Build 1709 or later, you can opt instead to install Ubuntu on Windows via the Store (bit.ly/2Dm8fSR). To get the connection
Figure 3 Scatter Plot with Binary Classifier Indicated by Green Line
msdnmagazine.com
information, look for the Connect button on the blade for the DSVM instance. Click on it to bring up the dialog shown in Figure 2 to get the connection information.
In the terminal window, enter the connection information and, when prompted, enter “yes” to trust the connection, followed by the password for the username. To install and enable the xrdp service
to work with xfce4, enter the following three lines:
sudo apt-get install xrdp
echo xfce4-session >~/.xsession sudo service xrdp restart
If prompted, respond with “Y” to enable use of extra disk space. Once xfce is installed on the DSVM, you need to create a rule in the Network Security Group to allow RDP traffic through to the VM. This can be done via the Azure Portal (bit.ly/2mDQ1lt), or by issuing the follow statement into the command line through the Azure CLI:
az vm open-port --resource-group ResourceGroup --name DSVM-Name --port 3389
Be sure to replace “ResourceGroup” and “DSVM-Name” with the name of the Resource Group and VM name from earlier. Once that process completes, open the Remote Desktop Connect application, enter the IP address of the DSVM instance and click Connect. If prompted, choose to trust the machine and enter the credentials for the account created along with the DSVM.
All this configuration activity on the Ubuntu CLI may seem superfluous for a column about artificial intelligence, but bear in mind that many tools in this space assume a basic familiarity with Linux and the Bash command-line shell. The sooner you feel comfortable with Bash and Linux, the sooner you’ll be productive.
If you wish to avoid the preceding steps to install and configure xrdp, X2Go (wiki.x2go.org) is an alternative for Mac and Windows users. X2Go communicates directly to the DSVM via the xfce protocol, so there’s no need to install anything on the VM or to alter the Network Security Group. Simply install X2Go on your local desktop and con- nect with the IP address and username for the DSVM.
Once connected to the DSVM, click on the Applications menu in the upper-left corner of the GUI. Click on Development and click on JupyterHub on the resulting submenu. JupyterHub is a multi-user hub for managing multiple instances of the single-user Jupyter Notebook server. It can be used to serve notebooks to a group of users, such as students in a class, a research group or a team of data scientists.
A terminal window now opens and the system’s default browser (FireFox) opens to http://localhost:8888/tree. Click on the CNTK folder to access the Microsoft Cognitive Toolkit samples. Next, click on the CNTK_101_LogisticRegression.ipynb file to access the Logistic Regression and ML Primer notebook, which contains a tutorial for those new to machine learning and to the CNTK. This tutorial note- book is written for Python. If you receive the error, “Can’t execvp Jupyter:Nosuchfileordirectory,”you’llhavetouseX2Gotocontinue.
Classifying Tumors
The problem posed in the CNTK_101_LogisticRegression notebook centers around classifying tumor growths as either malignant or
March 2018 17


































































































   21   22   23   24   25