AI Crash Course

Book description

This friendly and accessible guide to AI theory and programming in Python requires no maths or data science background.

Key Features

  • Roll up your sleeves and start programming AI models
  • No math, data science, or machine learning background required
  • Packed with hands-on examples, illustrations, and clear step-by-step instructions
  • 5 hands-on working projects put ideas into action and show step-by-step how to build intelligent software

Book Description

AI is changing the world – and with this book, anyone can start building intelligent software!

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. Taking a graduated approach that starts with the basics before easing readers into more complicated formulas and notation, Hadelin helps you understand what you really 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:

  • Google Colab
  • Python
  • TensorFlow
  • Keras
  • 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.

What you will learn

  • Master the key skills of deep learning, reinforcement learning, and deep reinforcement learning
  • Understand Q-learning and deep Q-learning
  • Learn from friendly, plain English explanations and practical activities
  • Build fun projects, including a virtual-self-driving car
  • Use AI to solve real-world business problems and win classic video games
  • Build an intelligent, virtual robot warehouse worker

Who this book is for

If you want to add AI to your skillset, this book is for you. It doesn't require data science or machine learning knowledge. Just maths basics (high school level).

Publisher resources

Download Example Code

Table of contents

  1. Why subscribe?
  2. Contributors
    1. About the author
    2. About the reviewers
  3. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Get in touch
      1. Reviews
  4. Welcome to the Robot World
    1. Beginning the AI journey
    2. Four different AI models
      1. The models in practice
        1. Fundamentals
        2. Thompson Sampling
        3. Q-learning
        4. Deep Q-learning
        5. Deep convolutional Q-learning
    3. Where can learning AI take you?
      1. Energy
      2. Healthcare
      3. Transport and logistics
      4. Education
      5. Security
      6. Employment
      7. Smart homes and robots
      8. Entertainment and happiness
      9. Environment
      10. Economy, business, and finance
    4. Summary
  5. Discover Your AI Toolkit
    1. The GitHub page
    2. Colaboratory
    3. Summary
  6. Python Fundamentals – Learn How to Code in Python
    1. Displaying text
      1. Exercise
    2. Variables and operations
      1. Exercise
    3. Lists and arrays
      1. Exercise
    4. if statements and conditions
      1. Exercise
    5. for and while loops
      1. Exercise
    6. Functions
      1. Exercise
    7. Classes and objects
      1. Exercise
    8. Summary
  7. AI Foundation Techniques
    1. What is Reinforcement Learning?
    2. The five principles of Reinforcement Learning
      1. Principle #1 – The input and output system
      2. Principle #2 – The reward
      3. Principle #3 – The AI environment
      4. Principle #4 – The Markov decision process
      5. Principle #5 – Training and inference
        1. Training mode
        2. Inference mode
    3. Summary
  8. Your First AI Model – Beware the Bandits!
    1. The multi-armed bandit problem
    2. The Thompson Sampling model
      1. Coding the model
      2. Understanding the model
      3. What is a distribution?
      4. Tackling the MABP
      5. The Thompson Sampling strategy in three steps
      6. The final touch of shaping your Thompson Sampling intuition
      7. Thompson Sampling against the standard model
    3. Summary
  9. AI for Sales and Advertising – Sell like the Wolf of AI Street
    1. Problem to solve
    2. Building the environment inside a simulation
      1. Running the simulation
      2. Recap
    3. AI solution and intuition refresher
      1. AI solution
      2. Intuition
    4. Implementation
      1. Thompson Sampling vs. Random Selection
        1. Performance measure
      2. Let's start coding
      3. The final result
    5. Summary
  10. Welcome to Q-Learning
    1. The Maze
      1. Beginnings
      2. Building the environment
        1. The states
        2. The actions
        3. The rewards
      3. Building the AI
        1. The Q-value
        2. The temporal difference
        3. The Bellman equation
        4. Reinforcement intuition
    2. The whole Q-learning process
      1. Training mode
      2. Inference mode
    3. Summary
  11. AI for Logistics – Robots in a Warehouse
    1. Building the environment
      1. The states
      2. The actions
      3. The rewards
      4. AI solution refresher
        1. Initialization (first iteration)
        2. Next iterations
    2. Implementation
      1. Part 1 – Building the environment
      2. Part 2 – Building the AI Solution with Q-learning
      3. Part 3 – Going into production
      4. Improvement 1 – Automating reward attribution
      5. Improvement 2 – Adding an intermediate goal
    3. Summary
  12. Going Pro with Artificial Brains – Deep Q-Learning
    1. Predicting house prices
      1. Uploading the dataset
      2. Importing libraries
      3. Excluding variables
      4. Data preparation
        1. Scaling data
      5. Building the neural network
      6. Training the neural network
      7. Displaying results
    2. Deep learning theory
      1. The neuron
        1. Biological neurons
        2. Artificial neurons
      2. The activation function
        1. The threshold activation function
        2. The sigmoid activation function
        3. The rectifier activation function
      3. How do neural networks work?
      4. How do neural networks learn?
      5. Forward-propagation and back-propagation
      6. Gradient Descent
        1. Batch gradient descent
        2. Stochastic gradient descent
        3. Mini-batch gradient descent
    3. Deep Q-learning
      1. The Softmax method
      2. Deep Q-learning recap
      3. Experience replay
      4. The whole deep Q-learning algorithm
    4. Summary
  13. AI for Autonomous Vehicles – Build a Self-Driving Car
    1. Building the environment
      1. Defining the goal
      2. Setting the parameters
      3. The input states
      4. The output actions
      5. The rewards
    2. AI solution refresher
    3. Implementation
      1. Step 1 – Importing the libraries
      2. Step 2 – Creating the architecture of the neural network
      3. Step 3 – Implementing experience replay
      4. Step 4 – Implementing deep Q-learning
    4. The demo
      1. Installing Anaconda
      2. Creating a virtual environment with Python 3.6
      3. Installing PyTorch
      4. Installing Kivy
    5. Summary
  14. AI for Business – Minimize Costs with Deep Q-Learning
    1. Problem to solve
    2. Building the environment
      1. Parameters and variables of the server environment
      2. Assumptions of the server environment
        1. Assumption 1 – We can approximate the server temperature
        2. Assumption 2 – We can approximate the energy costs
      3. Simulation
      4. Overall functioning
      5. Defining the states
      6. Defining the actions
      7. Defining the rewards
      8. Final simulation example
    3. AI solution
      1. The brain
      2. Implementation
      3. Step 1 – Building the environment
      4. Step 2 – Building the brain
        1. Without dropout
        2. With dropout
      5. Step 3 – Implementing the deep reinforcement learning algorithm
      6. Step 4: Training the AI
        1. No early stopping
        2. Early stopping
      7. Step 5 – Testing the AI
    4. The demo
    5. Recap – The general AI framework/Blueprint
    6. Summary
  15. Deep Convolutional Q-Learning
    1. What are CNNs used for?
    2. How do CNNs work?
      1. Step 1 – Convolution
      2. Step 2 – Max pooling
      3. Step 3 – Flattening
      4. Step 4 – Full connection
    3. Deep convolutional Q-learning
    4. Summary
  16. AI for Games – Become the Master at Snake
    1. Problem to solve
    2. Building the environment
      1. Defining the states
      2. Defining the actions
      3. Defining the rewards
    3. AI solution
      1. The brain
      2. The experience replay memory
    4. Implementation
      1. Step 1 – Building the environment
      2. Step 2 – Building the brain
      3. Step 3 – Building the experience replay memory
      4. Step 4 – Training the AI
      5. Step 5 – Testing the AI
    5. The demo
      1. Installation
      2. The results
    6. Summary
  17. Recap and Conclusion
    1. Recap – The general AI framework/blueprint
    2. Exploring what's next for you in AI
      1. Practice, practice, and practice
      2. Networking
      3. Never stop learning
  18. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think
  19. Index

Product information

  • Title: AI Crash Course
  • Author(s): Hadelin de Ponteves
  • Release date: November 2019
  • Publisher(s): Packt Publishing
  • ISBN: 9781838645359