Free eBook - AI Crash Course

5 (3 reviews total)
By Hadelin de Ponteves
  • A new free eBook every day on the latest in tech
  • 30 permanently free eBooks from our core tech library
  1. Welcome to the Robot World
About this book
Welcome to the Robot World … and start building intelligent software now! Through his best-selling video courses, Hadelin de Ponteves has taught hundreds of thousands of people to write AI software. Now, for the first time, his hands-on, energetic approach is available as a book. Starting with the basics before easing you into more complicated formulas and notation, AI Crash Course gives you everything you need to build AI systems with reinforcement learning and deep learning. Five full working projects put the ideas into action, showing step-by-step how to build intelligent software using the best and easiest tools for AI programming, including Python, TensorFlow, Keras, and PyTorch. AI Crash Course teaches everyone to build an AI to work in their applications. Once you've read this book, you're only limited by your imagination.
Publication date:
November 2019


Welcome to the Robot World

"We are truly living in the most exciting time to be alive!" These words, by the great tech entrepreneur Peter Diamandis, are even more true for people working in the artificial intelligence (AI) ecosystem. There is a reason why AI jobs are considered the sexiest jobs of the 21st century: besides being very well paid, AI is a fantastic topic to work on.

AI is taking a more and more important place in the world, and today we can find applications of it in almost all industries. This is not a temporary trend; AI is here to stay. As the top AI leader and influencer Andrew Ng said, AI is the new electricity. Just like the industrial revolution transformed lives and jobs in the 19th century, AI is about to do the same in this 21st century. Hence, the more you understand and know how to use it, the more opportunities will open up to you.

To give you some important figures, according to a study done by PricewaterhouseCoopers (PwC), AI could contribute up to $15.7 trillion to the global economy by 2030, which is more than the current output of China and India combined. So, you've definitely made a great choice to study this field. Welcome to the incredible world of Artificial Intelligence!

In this chapter, you will begin your AI journey with a top-level view of everything you'll learn from this book as you read and work through the chapters ahead with me. Then, I'll help you understand where learning AI can take you, by going through a variety of top industry applications for Artificial Intelligence.


Beginning the AI journey

Being a young AI scientist, I remember my first days in AI very well. This is important because this book is a crash course in AI. You don't need any prior knowledge of the field to work through the chapters.

In this book, I will explain the solid foundations of AI, while making sure to answer all the questions that I had back when I started in this field in detail. This means that everything will be explained step by step, and your learning process will follow a smooth path, supported by the relevant logic.

Having the right information at your fingertips is not enough to successfully break into the AI world. What you also need is energy, enthusiasm, and excitement. Even better, you need passion, and ideally obsession, about the subject. As an experienced tutor of online courses, I hope to pass on my knowledge and, most importantly, my passion.

In this book, you will go on a journey together with me, taking a path through a world of exciting AI applications, including many real-world case studies in the chapters. The applications will follow an increasing level of difficulty, from the simplest model in AI, to a much more advanced level.

For each of the AI applications, I will focus mostly on the intuition needed to understand them, and then, for those interested in the mathematics and pure theory behind the application, I will provide those as an option. The reason why I choose to focus on intuition rather than math is not only because I want to make this book easy to understand for everyone, but also because, in order to perform well in AI today, it is extremely important to have the right intuition. When you're solving a problem with AI, you have to figure out which model best fits your problem environment, and you can only do that when you have the proper intuition of how each AI model works.


Four different AI models

These AI models were chosen to be part of this book because they are used in a great variety of industry applications and can solve many different real-world problems. I'll just reveal their names here before we study them in depth across the book. The four AI models you will learn everything about in this book are the following:

  1. Thompson Sampling
  2. Q-learning
  3. Deep Q-learning
  4. Deep convolutional Q-learning

For each of these four models, we will follow the same three-step approach:

  1. Get an intuitive understanding of how it works.
  2. Get all the math behind the theory.
  3. Implement the model from scratch in Python.

I have followed this structure many times with my students, and I can tell you that it works the best. The idea is simple: because you start with your intuition, you won't get overwhelmed by the math, but will instead understand it more easily. You'll also feel comfortable coding some models of which you both have an intuitive understanding and in-depth theoretical knowledge.

The models in practice

All the way through this book you'll find practical examples to learn from or implement yourself. Here's a list of the AI implementations you'll find in the chapters of this course, which start in Chapter 3 after you get the tools you need for your AI journey in Chapter 2.


Chapter 3, Python Fundamentals – Learn How to Code in Python, contains the Python coding fundamentals you'll need for this book. You can remind yourself, or learn from scratch, how to code in Python.

Chapter 4, AI Foundation Techniques, contains a pseudocode example to illustrate the five core principles of Artificial Intelligence.

Thompson Sampling

Chapter 5, Your First AI Model – Beware the Bandits!, contains introductory code to illustrate the theory behind the Thompson Sampling AI model.

Chapter 6, AI for Sales and Advertising – Sell like the Wolf of AI Street, contains a real-world implementation of the Thompson Sampling model, applied to online advertising.


Chapter 7, Welcome to Q-Learning, contains pseudocode to illustrate the theory of the Q-learning AI model.

Chapter 8, AI for Logistics – Robots in a Warehouse, contains a real-world implementation of the Q-learning model, applied to process automation and optimization.

Deep Q-learning

Chapter 9, Going Pro with Artificial Brains – Deep Q-Learning, contains introductory code to illustrate the theory behind Artificial Neural Networks.

Chapter 10, AI for Autonomous Vehicles – Build a Self-Driving Car, contains a real-world implementation of the Deep Q-learning model, applied to self-driving cars.

Chapter 11, AI for Business, contains another real-world implementation of the Deep Q-learning model, applied to energy and business.

Deep convolutional Q-learning

Chapter 12, Deep Convolution Q-Learning, contains introductory code to illustrate the implementation of a Convolutional Neural Network (CNN).

Chapter 13, AI for Video Games – Become the Master at Snake, contains a real-world implementation of the deep convolutional Q-learning model applied to a game.

As you can see, every time you're introduced to a new model, you learn the intuition first, then the math, and then you move to an implementation of the model. So, why is learning how to implement these models worth your while?


Where can learning AI take you?

I'd like to motivate you by showing you that you made the right choice to learn AI. To do this, I'll take you on a tour of all the incredible applications AI can and will have in the 21st century. I have a vision of how AI can transform the world, and this vision is structured around 10 areas.


In 2016, Google used AI to reduce energy consumption in its data centers by more than 30%. If Google has done it for data centers, it could be done for an entire city. By building a smart AI platform using Internet of Things (IoT) technology, the consumption and distribution of energy can be optimized on a large scale.


AI has enormous promise for healthcare. It can already diagnose diseases, make prescriptions, and design new drug formulas. Combining all these skills into a smart healthcare platform will allow people to benefit from truly personalized medical care. This would be amazing for society. The challenges in achieving this are not only present in the technology, but also in getting access to anonymous patient data, which so far is protected by regulations.

Transport and logistics

Self-driving vehicles are becoming a reality. There is still a lot to achieve, but the technology is constantly improving. By building smart digital infrastructures, AI will help reduce the number of accidents and considerably reduce traffic. Also, self-driving delivery trucks and drones will speed up logistic processes, therefore boosting the economy; mostly through one of its bigger engines, the e-commerce industry.


Today, we live in the era of Massive Open Online Courses. Anyone can learn anything online. This is great because the whole world can get access to an education; but it's definitely not enough. A significant improvement would be the personalization of education; everyone learns differently, and at different paces. Some, namely extroverts, will prefer the classroom, while others, introverts, will learn better at home. Some are more visual, while others are more auditory. Taking these and other factors into account, AI is a powerful technology that could deliver personalized training, optimizing everyone's learning curve.


Computer vision has made tremendous technological progress. AI can now detect faces with a high level of accuracy. Not only that, the number of security cameras is increasing significantly. All this could be integrated into a global security platform to reduce crime, increase public safety, and disincentivize people from breaking the law. Besides this, AI and Machine Learning are powerful technologies already used in fraud detection and prevention.


AI can build powerful recommender systems. We already see platforms of digital recruitment, where AI matches the best candidates to jobs. This not only has a positive impact on the economy, but also on people's happiness, since work makes up more than half of a person's life.

Smart homes and robots

Smart homes, IoT, and connected objects are developing massively. Robots will assist people in their homes, allowing humans to focus on more important activities like their work or spending quality time with their family. They will also help elderly people to live in their home independently, or even allow them to stay active at work, for much longer.

Entertainment and happiness

One downside of technology today is that despite the fact people are so virtually connected, they feel more and more lonely. Loneliness is something we must fight against in this century, as it is very unhealthy for people. AI has a great role to play in this fight, since it is again a powerful recommender system, which can not only recommend relevant movies and songs to users, but also connect people through recommended activities based on their past experiences and common interests.

Through a global smart platform of entertainment, AI technology could help like-minded people to socialize and meet physically instead of virtually.

Another idea to fight loneliness is companion robots, which will be entering homes more and more over the next decade. One branch of AI in the Research and Development phase is emotion creation. This is the branch of AI that will allow robots to show emotions and empathy, and therefore interact more successfully with humans.


Using computer vision, machines could optimize waste sorting and redistribute the cycles of trash more efficiently. Combining pure AI models with IoT can optimize power and water consumption by individuals. Programs already exist on some platforms that allow people to track their consumption in real time, therefore collecting data. Integrating AI could minimize this consumption, or optimize the distribution cycles for beneficial reuse. Combined with traffic reduction and the development of autonomous vehicles, this will considerably reduce pollution, which will create a healthier environment.

Economy, business, and finance

AI is taking the business world by storm. Earlier, I mentioned the study done by PwC showing how AI could contribute up to $15 trillion to the global economy in 2030 ( But how can AI generate so much income? AI can bring significant added value to businesses in three different ways: process automation, profit optimization, and innovation. In my vision of an AI-driven economy, I see the majority of companies adopting at least one AI technology, or having an AI department. In finance, we can already see some jobs being replaced by robots. For example, the number of financial traders was significantly reduced after the development of trading robots that perform well on high-frequency trades.

As you can see, the robot world has a lot of great directions for you to take. AI is already in a dynamic place and it's picking up strong momentum as it moves forward. My professional purpose is to democratize AI and incentivize people to make a positive impact in this world thanks to AI—who knows, perhaps your purpose will be to work with AI for the good of humanity. I'm sure that at least one of these 10 applications resonates in you; if that's the case, work hard to become an AI master and you will have the chance to make a difference.

If you are ready to break into AI, or simply want to increase your knowledge, let's begin!



In this chapter, you began your AI journey and saw the vast land of opportunities that will open to you. Perhaps you can already think of which industry application might resonate the most in you, so you can become even more passionate about what you do with AI and understand why you're doing it. In the next chapter, you will uncover the AI toolkit you will use in this book.

About the Author
  • Hadelin de Ponteves

    Hadelin de Ponteves is the co-founder and CEO at BlueLife AI, which leverages the power of cutting-edge Artificial Intelligence to empower businesses to make massive profits by optimizing processes, maximizing efficiency, and increasing profitability. Hadelin is also an online entrepreneur who has created 50+ top-rated educational e-courses on topics such as machine learning, deep learning, artificial intelligence, and blockchain, which have reached over 700,000 subscribers in 204 countries.

    Browse publications by this author
Latest Reviews (3 reviews total)
Perfect, awesome ... Perfect, awesome ... Perfect, awesome ...
a lot of info to learn
Great book!
Recommended For You
Hands-On Mathematics for Deep Learning

A comprehensive guide to getting well-versed with the mathematical techniques for building modern deep learning architectures

By Jay Dawani
Deep Learning with TensorFlow 2 and Keras - Second Edition

Build machine and deep learning systems with the newly released TensorFlow 2 and Keras for the lab, production, and mobile devices

By Antonio Gulli and 2 more
The Python Workshop

Learn the fundamentals of clean, effective Python coding and build the practical skills to tackle your own software development or data science projects

By Andrew Bird and 4 more
The Complete Python Course [Video]

Master Python and OOP concepts and structure your programs like a professional

By Codestars By Rob Percival and 1 more