Finding the dot product in Python without using Numpy

By | 2017-04-18T12:16:20+00:00 April 18th, 2017|machine learning, python|

In Deep Learning one of the most common operation that is usually done is finding the dot product of vectors. In very simple terms dot product is a way of finding the product of the summation of two vectors and the output will be a single vector. This Wikipedia article has more details on dot products. The following formula should make it clear where $latex \vec{X}&s=1$ and $latex \vec{Y}&s=1$ are vectors. $latex \vec{X}=(x_1,x_2...x_n)&s=1$ $latex \vec{Y}=(y_1,y_2...y_n)&s=1$ then the dot product formula will be $latex \vec{X}.\vec{Y}=(x_1y_1+x_2y_2+...+x_ny_n)&s=1$ Here is an example of dot product of 2 vectors. $latex \vec{X}=(6,5,4)\vec    {Y}=(3,2,1)&s=1$ so $latex \vec{X}&s=1$  dot $latex \vec{Y}&s=1$ will be $latex \vec{X}.\vec{Y}=(6*3+5*2+4*1) = 32&s=1$ Finding the dot [...]

Installation and configuration of Anaconda on Ubuntu

By | 2017-03-26T19:56:46+00:00 March 30th, 2017|languages, Linux, machine learning, operating systems, python|

This is a quick post on how to install/configure Anaconda on Ubuntu. We will also create virtual environments using Anaconda. What is Anaconda? Anaconda is a package manager for Python which makes it easy to install and configure packages which are usually used for Data Science related work using Python. As we did using virtualenv package, we can also create virtual environments using Anaconda. This helps us to work on multiple projects using various versions of packages completely isolated, all in a single computer. Installing Anaconda Anaconda can be downloaded from here. The installer is ~500 MB in size. Once downloaded, execute the following command [...]

The step by step guide to install TensorFlow on Windows

By | 2017-03-27T06:13:11+00:00 March 28th, 2017|languages, machine learning, operating systems, python, TensorFlow, Windows|

In the previous post we had installed TensorFlow in a virtualised environment on Ubuntu 16.04. In this post we will install TensorFlow on Windows 10 including all the pre-requisites. Since I have a laptop with NVIDIA GPU, I will install TensorFlow with GPU support. NVIDIA CUDA First of all we will install NVIDIA CUDA on Windows as installing TensorFlow with GPU support is recommended. We will download NIVIDIA CUDA from here. The installation is very straight forward, a few clicks and the installation is complete. Install Python 3.5 Once the CUDA installation is complete, initiate a reboot of the workstation. Then we need to install Python. On Windows TensorFlow supports versions 3.5.x versions [...]

How to install TensorFlow with GPU support using Python Virtualenv

By | 2017-03-26T19:59:36+00:00 March 27th, 2017|languages, Linux, machine learning, python, TensorFlow|

In this post I will install TensorFlow with GPU support using Virtualenv. I will be installing this on Ubuntu 16.04 however the steps will remain the same for other operating systems as well. Before we install TensorFlow please make sure that the following prerequisites are taken care of. Install NVIDIA CUDA (this if for GPU support) Install Virtualenv package on Python. The installation is pretty straight forward. First we need to create the Virtual environment using the following command [crayon-5ae28a80158c6083805626/] During the installation of virtualenv I had created a folder named myvirtualenv under my home directory. Hence I used that folder in the above command. [...]

Installing Virtualenv on Ubuntu for Tensorflow

By | 2017-03-24T06:28:44+00:00 March 24th, 2017|languages, Linux, machine learning, python, TensorFlow, tools|

In my series on getting started with TensorFlow, we have looked into Finding whether the workstation has NVIDIA GPU or not Installing NVIDIA CUDA on Linux In this post I will explain how to install Virtualenv on Ubuntu 16.04. What is Virtualenv? Virtualenv is a package for Python by installing which we will be able to create virtual environments for Python development. It is like we can have multiple virtual instances of Python and it's packages all in a single operating system. Here is an example how Virtualenv is useful. Let's say I want to develop two Python 3 applications for which I will be [...]

Installing CUDA Toolkit 8.0 on Ubuntu 16.04

By | 2017-03-21T10:39:00+00:00 March 22nd, 2017|Linux, machine learning, TensorFlow, tools|

As per TensorFlow documentation, following are the prerequisites to install TensorFlow with GPU support. In the previous post we tried various methods to find out if the GPU is from NVIDIA or not. In this post we will install NVIDIA CUDA on Linux. There few pre-installation steps to take care of. Here are some of the important ones GCC One of them is to ensure where GCC is installed or not. We can confirm it by executing the following command. [crayon-5ae28a801c397712910944/] Since I am using Ubuntu, GCC comes pre-installed and here is the output that I got. build essentials It is important have the build-essential package installed. This is [...]

Find GPU Information on Linux and Windows

By | 2017-03-20T21:24:07+00:00 March 21st, 2017|Linux, machine learning, operating systems, TensorFlow, Windows|

In the next few weeks I will be upgrading my skills on TensorFlow. As a step first I need to have TensorFlow installed on my laptop and VMs. As my regular readers on the blog you would know that Ubuntu is my primary operating system and I run Windows on my virtual machines for testing purposes. According to the installation page of TensorFlow, TensorFlow with GPU support (NVIDIA GPU) runs significantly faster than with CPU support only. The first question that comes to one's mind is what is GPU? As explained in this NVDIA's blog post, GPU is the Graphical Processing Unit of the computer [...]

“Error: xx is an unrecognized escape in character string starting ” when changing directory in R

By | 2014-08-30T01:12:40+00:00 September 2nd, 2014|machine learning, R|

Like me many of you might be using R on Windows. In this post I will explain a very basic activity that we do in R and how to resolve it. In the R console you want to change the Working Directory. The function to change the working directory is setwd(). The syntax for this function is setwd("PathOfTheDirectory"). I have my datasets stored in "C:\R\DataSets" directory and I want the working directory to it. I execute the following command in the R console. setwd("C:\R\DataSets") Instead of changing the directory I get the following error message. Error: '\R' is an unrecognized escape in character string starting [...]

Save and Load the history of your work in R

By | 2014-08-24T02:05:02+00:00 August 26th, 2014|machine learning, R|

There are times when you want to know the commands that you executed in a R session. R by default tracks all the commands that you type and saves it in a file named .Rhistory in your current working directory. To view the history in the current session just type history() in the R console and a new window with the commands that you typed in the past is loaded. Alternatively you can also open the .Rhistory file in a text editor to view the commands. There is also an option to track the commands that you execute in a file of your choice. The savehistory() [...]

R | The program can’t start because MSVCR100.dll is missing from your computer error while installing

By | 2014-08-16T23:51:33+00:00 August 19th, 2014|machine learning, R|

While installing R on Windows, there are chances that you may get the following error message after it is installed. The program can't start because MSVCR100.dll is missing from your computer. Try reinstalling the program to fix this problem. If you search for this error message, almost all of them recommend you to install "Microsoft Visual C++ 2010 Redistributable" package. The MSVCR installer has both 32 bit and 64 bit versions. By default you would chose the one which matches the CPU architecture of your workstation. In my case, I chose the 64 bit installer from here. Even after installing, rebooting, reinstalling MSVCR I still encountered [...]