Computing Workflows, Data Science, and such


Theano Deep MLP for MNIST

Finally, some neural net action! The Theano tutorial guided me in building the basic machinery for neural nets. I verified their model on MNIST and then generalized it to an arbitrary number of hidden layers. Does this actually work better? Who knows, but it’s generally useful and now we can bang neural nets against all kinds of problems. Wee!

As a bonus, I got Theano working with my GPU. Granted, I’m running on a card that was obsolete 4 years ago, but it’s an improvement. If I could get it working with TensorFlow, I might switch back.

TensorFlow in SageMathCloud

Installing TensorFlow in SageMathCloud

TensorFlow isn’t always the most friendly library to install, but within SageMathCloud for a CPU-only version and Python3.4, it’s not too bad. Most of the pain comes from SageMathCloud cutting off our network access.

First, download the TensorFlow wheel file. Do this on your local computer, not SageMathCloud.

# Use wget from the command line, or search the tensorflow website under "Get Started"
wget https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-0.6.0-cp34-none-linux_x86_64.whl

Next, open a terminal in your SageMathCloud. We’ll use pip3 to install TensorFlow like you might a normal Python package, but we’ll pass in some options so that pip3 doesn’t try to download unneeded dependencies.

pip3 install --user --no-index --no-deps tensorflow-0.6.0-cp34-none-linux_x86_64.whl

That’s it! TensorFlow is now ready to use in a Python3 kernel under a Jupyter Notebook.

Theano Multinomial Logistic with MNIST

Progress continues with Theano as I try out the MNIST dataset. Their tutorial walks through building a generic logistic regression; I probably should have just made a more one-off solution. Maybe it’s just the nature of the tutorial, but this felt more natural when doing it in TensorFlow. And unlike neural nets, I’m very familiar with logistic regression.

Like always, I managed to introduce some stupid bugs during the stream. 15 minutes after shutting it down, I found my error and produced reasonable results.

DanDoesData Live at FUBAR Labs

This February 11th at 7 PM, I’ll be live at FUBAR Labs in New Jersey to guide a workshop on “Data Visualization and Machine Learning”. I’ll be showing people how to get started with Python plotting and visualization using SageMathCloud as well as describing some of today’s mystifying topics in the world of data science. RSVP on Meetup or show up at the door.

Also, I’m now on Twitter @DanDoesData! It’s another way to say hi or explain how I’m doing everything wrong.

Theano Installation and Intro

I’m back from my break and onto a new machine learning framework, Theano. On the surface, it’s similar to TensorFlow in that you describe a graph of computations to be compiled and executed. Sadly for those entertained by me royally screwing up, installation with pip was a breeze and I worked through many “Baby Steps” tutorials.

Next week I’ll continue exploring Theano for more advanced analyses. Also, due to a request from chat, I’ll look into creating a new video on how to setup and use my workflow.

Page 13 of 16