Mini-Project #5: TensorFlow (virtualenv + jupyter)

Due date: Friday 5 May 2017, 11:59:00 pm

This mini-assignment has you touch a bunch of cool technologies in a superficial way. The following skills are essential to being a python3 machine learning data jockey:

  • install a python virtualenv
  • run ML algorithms in TensorFlow
  • use Jupyter notebooks

So, we are going to do the following things. These instructions are for Ubuntu Xenial with python3.

  1. create and activate a python3 virtual environment called tensorflow
    python3 -m env ~/tensorflow
    source ~/tensorflow/bin/activate
    
  2. install tensorflow
      pip3 install --upgrade tensorflow
    
  3. install jupyter
      pip3 install --upgrade jupyter
    
  4. clone the tensor flow examples library
    git clone https://github.com/nlintz/TensorFlow-Tutorials.git
    
  5. run the logistic regression example
    jupyter notebook ./TensorFlow-Tutorials/02_logistic_regression.ipynb
    

    You will need to run each code block in the notebook to produce output. Figure this out.

Poke around the TensorFlow examples. It’s a powerful tool that allows you to run the same code on CPUs and GPUs.

Other environments

You can (and are encouraged to) use any environment that you want. To do so, you must do some googling to make it work. TensorFlow has install instructions for MacOSX and Windows. You want to install the CPU version (not GPU). The requirement for this project is Jupyter and TensorFlow. So, configure any python you want. Anyway you get it to run is fine. Environments that I know work include:

  • Ubuntu Xenial on VirtualBox on Windows and MacOSX.
  • Anaconda on Windows.
    • Follow the tensorflow instructions, but be sure to use python 3.5. The default 3.6 doesn’t work.
      conda create --name tensorflow python=3.5
      
  • Python3 in virtualenv on MacOSX Sierra.

Docker is also possible, but annoying for networking reasons.

What to turn in?

A screenshot that includes the last iterations of your algorithm and the MAC address of the computer that you ran on. Add the following code to the Python notebook:

    from uuid import getnode as get_mac
    mac = get_mac()
    print(mac)

and run the code block. In BlackBoard, you should turn in an image (.png or .jpg) that looks something like the following. Turn in only the image.