#!/usr/bin/env python # coding: utf-8 # # Python Setup for the ComputeFest Deep Learning Workshop # # Hi there! Thank you for joining us for the deep learning workshop at the ComputeFest 2016! We want to make this workshop interactive, so you can get some hands on experience instead of just following a lecture. To make this possible, it is important that you make sure all the neccessary libraries are up and running on your laptop. # # We will be using Python 2.7 with [Ipython](http://ipython.org) notebooks, as well as [Theano](deeplearning.net/software/theano). You should also have a basic understanding of git and how to clone a repository. You should be reasonably comfortable with operating on the command line of your chosen OS, as well. # # This document is meant to provide some pointers on how to install these libraries. Feel free to alter the environment to your preferred setup. # # Installation should be pretty straight forward for Mac or Linux users. If you are using Windows, don't despair, I am using it myself and there are some tips below that hopefully will enable you to make it work. # # You can download this notebook [here](https://raw.githubusercontent.com/vkaynig/ComputeFest2015_DeepLearning/master/Pre-workshop%20Setup.ipynb), or by clicking on the download symbol in the upper right corner if you are viewing this in the nbviewer. # # ## Basic Python installation # * We are using Python 2.7 # # * If you don't have Python installed yet, you can use a distribution like [Enthought Canopy](https://www.enthought.com/products/epd/) (previously EPD) . Note that this distribution is only free if you are affiliated with a university. # # * Anaconda is another Python distribution that is generally free. # # * If you are using Windows, and you don't have access to Enthought and Anaconda is not working for you, see below on to help you install the environment from scratch. # # * Similarly, if you are using OSX and aren't already set up with a recent version of python, see below. # # #### Installing Python under Windows 8 from scratch # # * We don't recommend using virtual environments for Windows (unless you are an expert). # # * Install the 2.7 32-bit version of Python from [python.org](https://www.python.org/downloads/). # # * Install MinGW following [these instructions](http://www.mingw.org/wiki/Getting_Started). # # * Put the path to MingW into your path environment variable. You can access the variable by hitting win+S and searching for 'environment'. Then choose the path variable for your account and add ';C:\MinGW\bin' to the end. # # * Use the pre-compiled packages provided by [Christoph Gohlke](http://www.lfd.uci.edu/~gohlke/pythonlibs) to install 'numpy-mkl', 'scipy', 'theano', and 'pip'. # # # #### Installing Python under OSX # # * We strongly suggest using [homebrew](brew.sh). # * Make sure /usr/local/bin is on your path. # * Install the latest python # ``` # brew install python # ``` # * Make sure you see the correct python # ``` # which python # ``` # should report /usr/local/bin/python # * Install virtualenv # ``` # pip install virtualenv # ``` # * Create and activate a new virtual environment # ``` # virtualenv DeepLearningWorkshop # source DeepLearningWorkshop/bin/activate # ```` # # # ## Installing Ipython # For the workshop we will be using Ipython notebooks. You can install the necessary packages with 'pip'. # # * [IPython installation instructions](http://ipython.org/ipython-doc/stable/install/install.html) # # * You can test if the setup works by executing 'ipython notebook' on the command line. This should open a browser window showing an option to create a new ipython notebook. # # * At this point you can also download this IPython notebook and execute it yourself. You will need to do this at the end to see if you can execute the script that tests your setup. # # ## Getting friendly with git # The installation of Theano involves very basic git commands. If you don't care about the specifics you most probably will be able to finish the installation by just copy and pasting the commands from the Theano installation documentation. If you would like to get some more input on what you are doing, here are some useful resources: # # * First of all, it does not hurt to just google `git tutorial` and have a look at some of the pages. # * There is a nice [interactive tutorial](https://try.github.io/levels/1/challenges/1) from Github. # * And here is a [git cheat-sheet](https://training.github.com/kit/downloads/github-git-cheat-sheet.pdf) in case you need a quick reference. # # ## Installing Theano # Theano is a great library for deep learning, even providing transparent execution of your code on the GPU (though only on NVIDIA GPUs). The developers did a great job not only with the library itself, but also with the documentation. # # For the workshop you should have a working installation of Theano on the CPU, GPU processing is optional and will make computations much faster, but might be not suitable for your laptop configuration. # # * If you didn't install theano from another source, see [Theano's dependencies and Basic installation instructions](http://deeplearning.net/software/theano/install.html) # ## Checking if everything works # # If you have installed everything needed for the workshop successfully you should be able to import theano without problems: # In[3]: from theano import * import theano.tensor as T