Sunday, October 9, 2016

TensorFlow Tutorial

Overview

Here, I would like to share my experience with using TensorFlow. In the process, you will learn how to set it up and use it for your projects.

Setting it up

This is the official link and the most reliable one. The only problem with it is that you cannot distinguish which ones are the main headings and what are sub-headings unless you pay attention to the side bar. This leads to confusion of what to install and what not to install. Let me summarize it for you here:

Main point to note is that TensorFlow needs python. In addition, if you are exploring GPU version, it needs Cuda Toolkit and cuDNN. There are two main ways to install Tensorflow:
  1. From binary packages
  2. From github source

First option

First option is the easiest and I feel one should prefer this unless you are using different version of the packages on which the TensorFlow depends on. Even under the first option, there are multiple ways to accomplish this:
  1. Pip install
  2. Virtualenv install
  3. Anaconda install
  4. Docker install
As indicated on the official link, pip install might affect existing Python programs on the machine. The others do not affect. Among the options, I found Anaconda install to be the easiest. Installing Anaconda is a piece of cake as per my experience. Here are the details on how to install it. Once you have that setup, you can install TensorFlow also very quickly.

If you are okay with CPU version, you are done and are ready to start using TensorFlow.

In case you want to use GPU version (supported at present only on Linux), you need to install right versions of Cuda Toolkit as well as cuDNN. Then, export the relevant variables. You are done. You can find the exact details on the official link. Getting Cuda binary would require you to register on their site.

Second option

I was not successful when I tired to setup TensorFlow with this option. I had issues with Bazel. In case you want to explore this one, following the official link might help. I tried the steps mentioned on few blogs and that didn't work well for me.

Learning a DNN

Let us start simple. I built a simple logistic regression model for Iris dataset following the steps indicated in the this link. Iris data can be obtained from UCI. Replace 

ipd = pd.read_csv("iris.csv")

with

ipd = pd.read_csv("iris.data.txt",names=['Sepal Length','Sepal Width','Petal Length','Petal Width')

Once you run the script end-to-end, you can add a hidden layer and repeat the process to check if the hidden layer helped. When I added a hidden layer with 5 nodes, it did not result in any improvement. This makes sense as the number of features and data points are small.

Next, I tried with Adult dataset, which is also part of UCI repository. Here is the python notebook for it.

Sunday, September 4, 2016

TOEFL Tutorial

Overview

I have taken TOEFL two times - First time scored 110 and second time, 112. Here, I would like to share my learnings. Hope it would help you score the highest in your TOEFL.

However, my knowledge is not complete and I might have missed some useful tips/resources. I request you to contribute and indicate your tip to get the top score in TOEFL in the comments section below. Thanks in advance!


Important Things to Note

  1. To be allowed to take the exam, all you need are 2 things! Valid, acceptable identification document (Passport in India) and a print out of your order confirmation.
  2. The fee includes the cost of sending your score card to up to 4 universities. The list of the universities can be changed till 10pm the previous day of the exam. Don't forget to use this facility! Instead of just picking top 4 colleges in your list, look on their site if they really need you to submit TOEFL score. Some colleges give waivers. Others require you to just mention the score in the application. They require official score card only if you get admitted. 
  3. During registration, you will be given an option to add packages that include practice tests. If you are a first timer and not attending any institute that gives you full length practice tests with similar UI as TOEFL iBT, I recommend you to go for one of these add-on packages.
  4. You are only allowed to take your identification document inside and absolutely nothing else - No pen, no order confirmation slip, no napkin, nothing. So, keep all of this in the locker. They will provide scratch paper and pencils for you to jot down notes during the test.
  5. Switch off your phone - not in silent or airplane mode. If they sense any signals from your phone, they can interrupt you amidst the test and that means, loss of your test time (Test cannot be paused in between. Timer keeps running).
  6. The entire exam is around 4 hours long. So, carry some snacks with you. You can eat them when you get a break of 10 minutes after Reading and Listening sections are done, if you feel hungry. At my center, the key to the locker they provided, is not given during the break. Hence, it is best to keep the water bottle and snacks outside the locker.
  7. There is no negative marking. Hence, try to answer all the questions.
  8. While the questions in the Reading Section can be reviewed later, it is not so in the case of questions in the Listening Section. In the Listening Section, you need to confirm the answer and move on to the next - You click on "Next" first and then, click on "Ok" to go to the next question. You cannot come back to it again. Remember this!
  9. Another peculiarity of the Listening Section is this: All that you read and hear disappear immediately after reading or speaking is done. They will not be available to you when you are answering the questions. So, read and hear with all attention when time is given to you for the same. 

Links you must go through

  1. For me, speaking seemed the toughest. This site is just the solution for all the sections, especially speaking section. I felt the tips provided to be top notch.
  2. The officially available resources can be found here.

  • Official tips under Video Library
  • More videos under TOEFLtv channel (The fact that it has only 80k subscribers till date says how less people are aware of this!)
  • Four official sample question papers here. The last two papers have audios linked with them, instead of transcripts making the sample paper more close to the real test. Each has solutions provided at the end. The solutions on speaking and writing sections, basically, says key information looked for in the responses - can help you understand what they expect in the responses better than just going through Scoring Rubric.
  • Interactive Sampler. Don't forget this sample test. It gives you a chance to get familiarized with the exact interface you will be encountering when taking the test.

Practice Time

There are multitude of links that provide free sample questions. Some even have sample responses. Make use of these links, especially ones I have mentioned below. Before exhausting these questions, try a few of them and master the pattern of answering with the tips you learned from links in the previous section by repeated attempts. Then, try the others.
  1. ouliogroove playlists: I could not go through all. But, I found their speaking tasks playlist to be the best, covering sample questions with responses for all six types of speaking questions
  2. YouTube channels like English Passio and Kindle Prep, also, have practice tests. Go through them.
However, if you want a sample test that exactly matches in format and UI as on the day of the exam, go for ETS add-on package that includes practice tests. More details on this can be found here. I, highly recommend, taking one official practice test for the first timers. I went with the basic package with one practice test when I took test for the first time. Take this test when you feel you are ready, but, still have a month or so to improve upon.


All the Best!

Do comment with your TOEFL score if you think reading this post helped you.