4 Steps To Learn TensorFlow When You Already Know scikit-learn

Many data enthusiasts of today learned Data Science basics a few years ago, with the classical winning triptych :

  • Andrew Ng MOOC
  • Kaggle
  • scikit-learn

At Zelros, several of us started data science in 2013. It was before Andrew Ng was hired by Baidu, before the aborted attempt of Kaggle to pivot on energy consulting business, and before out-of-core learning (partial_fit) was generalized in scikit-learn!

At this time, Spark, word2vec, and Xgboost were not yet mainstream — instead, Map-Reduce, TF-IDF and Random Forest, were the champions.

But with Data, things are going fast, a year is an eternity — you have to learn fast (or die).

Our team at Zelros loves learning new things. TensorFlow is one of the many technologies we decided to leverage. Here is how we did it.

Step 1 : watch the Udacity Deep Learning Online Course, by Google

This is really a great starting point, and the video are easily available on Youtube. You will learn the Deep Learning basics, in a very practical way. The course covers the main application areas of Deep Learning like classification of tabular data (with fully connected networks), images (with Convolutional Networks) or text (with embeddings and Recurrent Neural Networks).

This course is the opportunity to apprehend the key concepts that you must understand to gain confidence with deep learning : essentially logit, softmax, cross entropy, Gradient Descent, mini-batch, ReLUs, back-propagation, regularization, …

If you have already played with scikit-learn classifiers, some of these concepts will ring a bell, even if in the case of deep learning you must have a more thorough understanding to use TensorFlow, as we will see below.

Step 2 : look at the associated Python Notebooks

They are the companion notebooks of the Udacity course.

If you know scikit-learn and Python, and have watched Step 1 online courses, you won’t have difficulties to follow. Instead, what will strike you is the length and relative complexity of the code compared to scikit-learn.

Some low level tasks that are handled for you by scikit-learn, are done manually in these notebooks. Like :

  • computing the logits and the loss
  • iterating by hand to run the gradient descent

EDIT : However, this is going to change as high level object-oriented APIs will be added to TensorFlow in the near future.

Step 3 : read some literature

This is a pleasant part : now that you have the concepts in mind (Step 1), and viewed some concrete code (Step 2), you are armed to read and understand some papers to enforce your knowledge on deep learning in general — and TensorFlow at the end.

Be curious, and follow various links on twitter, reddit, google, … — the goal is not to read everything but to sample readings and improve your understanding and intuition on things.

Here are some jewels we discovered, and that you will be able to grasp :

An overview of gradient descent optimization algorithms — S. Ruder

Step 4: experiment!

It’s now time to play by yourself! You need a dataset : here is a nice one on Kaggle : the Leaf Classification competition.

What is great with this dataset is that it contains the raw binary leaf images, but also their already pre-extracted features (shape, margin & texture).

As a first step, you can start building a Neural Network classifier that uses the provided pre-extracted features. Get the sample codes of Step 2, and try to adapt it to this new dataset. Here is a Notebook example on this dataset.

Congrats! You made your first steps using TensorFlow — it’s now time to iterate and keep on learning!

We shared our method to dive into TensorFlow, hopping that some of you may want to follow the same path. If you want to practice in a highly motivating environment, just drop us an email, we are hiring ;) !