Jump to Content
AI & Machine Learning

The book for getting hands-on with machine learning, deep learning and TensorFlow

February 7, 2017
Justin Kestelyn

Product Marketing Lead

This new book from YouTube’s former video classification lead introduces readers to concepts as well as practical implementations of deep learning.

Machine learning consultant Aurélien Géron is the author of the O'Reilly Media book "Hands-on Machine Learning with Scikit-Learn and TensorFlow" (in Early Release mode at the time of this writing). A former Googler (and former student of microbiology and evolutionary genetics before going into software engineering), Aurélien led the YouTube video classification team from 2013 to 2016.

In the following Q&A, Aurélien offers some insights into the current state of machine learning, and some of the decisions behind the design and writing of his book. (Learn more about machine learning with TensorFlow in bootcamps, codelabs and technical sessions during Google Cloud NEXT ‘17 in San Francisco next month.)

https://storage.googleapis.com/gweb-cloudblog-publish/images/book-for-hands-on-deep-learningbqf0.max-400x400.PNG

Why did you decide to write this book?

When I first started to educate myself about machine learning, tons of resources were available, but most of them were designed for researchers rather than engineers. After reading several books, I still had no idea how to code what I had learned. So, I decided to write the book that I wish I had a few years ago: a complete package that helps developers who may know nothing about the subject learn how to build and train production-ready neural networks. My hope is that it will save plenty of time for plenty of people.

What will readers learn from this book, exactly?

In short, readers will learn how to use Scikit-Learn, the popular Python framework for general machine learning, and TensorFlow, the open source framework for doing deep learning, to build systems that can learn from data.

The first part of the book begins with fundamental concepts, domains and challenges of machine learning. Then, I take readers through an example project (predicting house values), step by step, using Scikit-Learn.

The second part of the book takes readers inside deep learning and TensorFlow. They learn how to use TensorFlow to build and train deep neural networks, using some of the most recent techniques (such as batch normalization, weight-initialization techniques, dropout and more). They also explore how to build convolutional neural networks (including ResNet, GoogleNet and other state-of-the-art architectures), among other things. (See the TOC for a complete list.)

In your view, why has deep learning become such a popular subject recently?

To put it simply, because it has started to produce astounding results. Deep learning is not just for making efficient anti-spam systems anymore; now it’s powering self-driving cars, walking robots, human-level speech recognition and synthesis and much, much more. This is an amazing development!

But why now? Neural networks have been around for decades and haven’t changed much during that time. Why now?

Basically, because of the availability of more data and more computing power (particularly in the form of GPUs).

Neural nets require a lot of data for training, and there simply wasn’t enough data around for that 30 years ago. Whereas today, you can write a simple script and download TBs of images or text from the internet. Moreover, neural nets require a lot of computing horsepower, and computers were just too slow back then. Not only did computing power rise according to Moore’s Law, but we can also thank the gaming industry for creating affordable ultra-powerful computing devices (GPUs), which gave deep learning a major boost.Once big data and computing power started the deep learning tsunami, the industry started to invest, and now there's a positive feedback loop: more investors leads to more money, more money leads to more research and better results and applications — which in turn lead to even more money, investors and so on. Although feedback loops like this one often develop into bubbles, I'm confident that deep learning’s success has only just begun. My guess is that we're at the same stage as the World Wide Web in the late 1990s: Although it seemed like every good idea had already been grabbed by someone else, in fact, many great ideas (Facebook, YouTube, Twitter, and so on) were yet to come.

We've barely scratched the surface of deep learning’s potential. Moreover, there are many years of work to do by companies that want to take advantage of the techniques available even today.

What needs to happen for deep learning to become part of the mainstream developer toolkit?

In my experience, most organizations, big or small, don’t yet have the required infrastructure or mindset to get value from deep learning. For example, most companies have scattered their data across many small, specialized databases. In those cases, a precondition for deep learning is to build a “data lake” that data scientists can use to easily access, compare and analyze data of various origins. But this crucial step is inherently complex (requires building an infrastructure capable of handling vasts amount of data, supporting fine-grained data access and so on).

The second blocker can often be organization and culture. Data scientists need to be able to run experiments quickly on infrastructure that supports rapid, iterative development; strict 3-month development cycles just won’t work. Finally, if organizational culture is to act on emotional hunches rather than on data, then deep learning is unlikely to ever take root.

Finally, mainstream developers will need to learn deep-learning concepts and how to implement them, and that process is not as clearcut as learning a new programming language.

[Editor’s note: Google Cloud Machine Learning, a managed service and set of machine-learning APIs for mitigating lack of access to data, infrastructure, and skillsets, is now available.]

You had the choice of several deep-learning frameworks as a focus for the book. Why Scikit-Learn and TensorFlow?

I wanted the readers to use frameworks that would be easy to learn, yet sufficiently mature and powerful to be used in production, so that they wouldn’t have to learn another framework immediately after closing the book. Scikit-Learn was a good option because of its simplicity, elegant design, rich functionality and performance. It's also based on Python, which has become a leading language for machine learning and also has the advantage of concision and readability, which is good because I wanted to have lots of code examples in my book. For these reasons, in my opinion, Scikit-Learn is a great framework for learning machine learning.

Scikit-Learn has virtually no support for neural networks, however, so I needed to include another framework for deep learning. I was working at Google at the time, leading YouTube’s video-classification team, and we used Google Brain’s DistBelief (TensorFlow’s predecessor) to classify huge numbers of videos into millions of topics (and it scaled pretty well). So when TensorFlow was released as open source in 2014, I was naturally drawn toward that option. It's beautifully designed, has a great set of features, works on desktop and mobile, is production ready and optimized for GPUs, has great documentation and much more.

Furthermore, TensorFlow’s incredible momentum in just a few weeks after its launch, and the fact that Google uses it internally and has a large team working on it full time, convinced me that it would quickly become one of the most popular deep-learning frameworks. And it did!

What general advice do you have for developers who are interested in deep learning, and what are some of your other favorite resources in that area?

Personally, I watched countless hours of YouTube videos about machine learning created by Andrew Ng, Nando de Freitas, Geoffrey Hinton, Hugo Larochelle, and many other experts. (Andrew’s videos are particularly accessible for a beginner.) However, watching videos isn’t enough; you need to get your hands dirty, too.

Consider joining a MOOC, such as Andrew Ng’s course via Coursera, or participating in a Kaggle challenge. And, of course, you could explore the exercises and the code examples in my Jupyter notebooks at github.com/ageron/handson-ml.

There are also some great books online for no charge, such as Deep Learning by Ian Goodfellow, Yoshua Bengio, and Aaron Courville, which are typically more targeted at researchers than engineers. You'll get fantastic deep insights, but little or no code, so it can be hard to know where to begin when you want to actually start coding.

Finally, I would like to conclude with two simple recommendations:

  • Start simple: Don’t start machine learning with a neural network; rather, try a simple linear regression model. Then, ramp up gradually.
  • Focus: Machine learning is quite a broad domain, so if you try to cover every sub-domain in just a few weeks, you won't get very deep into any one of them. Instead, I recommend that you pick one thing you would really love to do (face recognition, for example, or training a robot to walk), and then write the code and iterate on it until it works well. After that experience, it will be much easier to dig deep into another topic. And then another.
We're living in amazing times, and I can’t wait to see what deep learning will bring us next!

Posted in