AI Crash Course: A fun and hands-on introduction to machine learning, reinforcement learning, deep learning, and artificial intelligence with Python
2/5
()
Artificial Intelligence
Q-Learning
Reinforcement Learning
Deep Learning
Neural Networks
Underdog
Power of Knowledge
Genius Loci
Future Is Now
Ai as a Solution
Installation
Ai Revolution
Virtual Environment
Ai in Various Industries
Anaconda
Rewards
Deep Q-Learning
Self-Driving Cars
Python
Machine Learning
About this ebook
Unlock the power of artificial intelligence with top Udemy AI instructor Hadelin de Ponteves.
Key Features- Learn from friendly, plain English explanations and practical activities
- Put ideas into action with 5 hands-on projects that show step-by-step how to build intelligent software
- Use AI to win classic video games and construct a virtual self-driving car
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.
What you will learn- Master the basics of AI without any previous experience
- Build fun projects, including a virtual-self-driving car and a robot warehouse worker
- Use AI to solve real-world business problems
- Learn how to code in Python
- Discover the 5 principles of reinforcement learning
- Create your own AI toolkit
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).
Related to AI Crash Course
Related ebooks
Learn AI with Python: Explore Machine Learning and Deep Learning techniques for Building Smart AI Systems Using Scikit-Learn, NLTK, NeuroLab, and Keras (English Edition) Rating: 5 out of 5 stars5/5Artificial Intelligence: Machine Learning, Deep Learning, and Automation Processes Rating: 4 out of 5 stars4/5Artificial Intelligence: The Complete Beginner’s Guide to the Future of A.I. Rating: 4 out of 5 stars4/5Artificial Intelligence Programming with Python: From Zero to Hero Rating: 4 out of 5 stars4/5Machine Learning with Tensorflow: A Deeper Look at Machine Learning with TensorFlow Rating: 0 out of 5 stars0 ratingsMachine Learning For Dummies Rating: 4 out of 5 stars4/5TensorFlow in 1 Day: Make your own Neural Network Rating: 4 out of 5 stars4/5Artificial Intelligence with Python Rating: 4 out of 5 stars4/5Prompt Engineering ; The Future Of Language Generation Rating: 3 out of 5 stars3/5Enterprise AI For Dummies Rating: 3 out of 5 stars3/5Artificial Intelligence Revolution: How AI Will Change our Society, Economy, and Culture Rating: 5 out of 5 stars5/5Large Language Models Rating: 2 out of 5 stars2/5Machine Learning For Beginners Guide Algorithms: Supervised & Unsupervsied Learning. Decision Tree & Random Forest Introduction Rating: 0 out of 5 stars0 ratingsDeep Learning Fundamentals in Python Rating: 4 out of 5 stars4/5Python Machine Learning Illustrated Guide For Beginners & Intermediates:The Future Is Here! Rating: 5 out of 5 stars5/5The Roadmap to AI Mastery: A Guide to Building and Scaling Projects Rating: 3 out of 5 stars3/5Artificial Intelligence: Learning about Chatbots, Robotics, and Other Business Applications Rating: 5 out of 5 stars5/5Generative AI: Navigating the Course to the Artificial General Intelligence Future Rating: 0 out of 5 stars0 ratingsGenerative AI Transformation Blueprint: Byte-Sized Learning Series, #3 Rating: 0 out of 5 stars0 ratingsIntroduction to LLMs for Business Leaders: Responsible AI Strategy Beyond Fear and Hype: Byte-Sized Learning Series Rating: 0 out of 5 stars0 ratings
Computers For You
The ChatGPT Millionaire Handbook: Make Money Online With the Power of AI Technology Rating: 4 out of 5 stars4/5CompTIA Security+ Get Certified Get Ahead: SY0-701 Study Guide Rating: 5 out of 5 stars5/5Mastering ChatGPT: 21 Prompts Templates for Effortless Writing Rating: 4 out of 5 stars4/5Creating Online Courses with ChatGPT | A Step-by-Step Guide with Prompt Templates Rating: 4 out of 5 stars4/5Elon Musk Rating: 4 out of 5 stars4/5Storytelling with Data: Let's Practice! Rating: 4 out of 5 stars4/5Computer Science I Essentials Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5UX/UI Design Playbook Rating: 4 out of 5 stars4/5The Innovators: How a Group of Hackers, Geniuses, and Geeks Created the Digital Revolution Rating: 4 out of 5 stars4/5Procreate for Beginners: Introduction to Procreate for Drawing and Illustrating on the iPad Rating: 5 out of 5 stars5/5Data Analytics for Beginners: Introduction to Data Analytics Rating: 4 out of 5 stars4/5Microsoft Azure For Dummies Rating: 0 out of 5 stars0 ratingsThe Self-Taught Computer Scientist: The Beginner's Guide to Data Structures & Algorithms Rating: 0 out of 5 stars0 ratingsFundamentals of Programming: Using Python Rating: 5 out of 5 stars5/5Deep Search: How to Explore the Internet More Effectively Rating: 5 out of 5 stars5/5Excel 101: A Beginner's & Intermediate's Guide for Mastering the Quintessence of Microsoft Excel (2010-2019 & 365) in no time! Rating: 0 out of 5 stars0 ratingsLearning the Chess Openings Rating: 5 out of 5 stars5/5The Musician's Ai Handbook: Enhance And Promote Your Music With Artificial Intelligence Rating: 5 out of 5 stars5/5Becoming a Data Head: How to Think, Speak, and Understand Data Science, Statistics, and Machine Learning Rating: 5 out of 5 stars5/5A Quickstart Guide To Becoming A ChatGPT Millionaire: The ChatGPT Book For Beginners (Lazy Money Series®) Rating: 4 out of 5 stars4/5CompTIA IT Fundamentals (ITF+) Study Guide: Exam FC0-U61 Rating: 0 out of 5 stars0 ratingsTechnical Writing For Dummies Rating: 0 out of 5 stars0 ratingsITIL Foundation Essentials ITIL 4 Edition - The ultimate revision guide Rating: 5 out of 5 stars5/5The Data Warehouse Toolkit: The Definitive Guide to Dimensional Modeling Rating: 0 out of 5 stars0 ratings
Reviews for AI Crash Course
1 rating1 review
- Rating: 2 out of 5 stars2/5
Jan 3, 2025
Take out your wallet in order to get coding examples.
Book preview
AI Crash Course - Hadelin de Ponteves
Preface
Hello, data scientists and AI enthusiasts. For many years I've created online courses on Artificial Intelligence (AI), which have been very successful and contributed well to the AI community. However, something essential was missing. At one point, so many AI courses were made that most of my students asked me for guidance on how to take the courses. So instead of providing an order in which to take the courses, I decided to create an all-in-one full guide to AI as a book, which would include in a perfect structure all the best explanations and real-world practical activities from my courses.
You see, my goal is to democratize AI and raise awareness among everyone of the fact that AI is an accessible technology that can make a difference for the better in this world. I am trying my best to spread knowledge around the world to get people prepared for the future jobs and opportunities of this 21st century. And I thought some people would learn AI much more efficiently from an all-in-one book they can take anywhere, rather than completing tens of online courses that can be hard to navigate. That being said, this book is also a great additional resource for those people who do prefer, and take, online courses.
My simple hope for this book is that more people learn AI the right way, as a result of me offering them this efficient alternative to online courses. I've succeeded at the challenge of including the best of my training in a single book, and today I'm truly happy to release it. I sincerely hope it will help more people land their dream job, grow an amazing career in data science or AI, and bring beautiful solutions to the tough challenges of this 21st century.
Who this book is for
Anyone interested in machine learning, deep learning, or AI.
People who aren't that comfortable with coding, but who are interested in AI and want to apply it easily to real-world problems.
College or university students who want to start a career in data science or AI.
Data analysts who want to level up in AI.
Anyone who isn't satisfied with their job and wants to take the first steps toward a career in data science.
Business owners who want to add value to their business by using powerful AI tools.
Entrepreneurs who are eager to learn how to leverage AI to optimize their business, maximize profitability, and increase efficiency.
AI practitioners who want to know what projects they can offer to their employees.
Aspiring data scientists, looking for business cases to add to their portfolio.
Technology enthusiasts interested in leveraging machine learning and AI to solve business problems.
Consultants who want to transition companies into being AI-driven businesses.
Students with at least high school knowledge in math, who want to start learning AI.
What this book covers
Chapter 1, Welcome to the Robot World, introduces you to the world of Artificial Intelligence.
Chapter 2, Discover Your AI Toolkit, uncovers an easy-to-use toolkit of all the AI models as Python files, ready to run thanks to the amazing Google Colaboratory platform.
Chapter 3, Python Fundamentals – Learn How to Code in Python, provides the right Python fundamentals and teaches you how to code in Python.
Chapter 4, AI Foundation Techniques, introduces you to reinforcement learning and its five fundamental principles.
Chapter 5, Your First AI Model – Beware the Bandits!, teaches the theory of the multi-armed bandit problem and how to solve it in the best way with the Thompson Sampling AI model.
Chapter 6, AI for Sales and Advertising – Sell like the Wolf of AI Street, applies the Thompson Sampling AI model of Chapter 5 to solve a real-world business problem related to sales and advertising.
Chapter 7, Welcome to Q-Learning, introduces the theory of the Q-learning AI model.
Chapter 8, AI for Logistics – Robots in a Warehouse, applies the Q-learning AI model of Chapter 7 to solve a real-world business problem related to logistics optimization.
Chapter 9, Going Pro with Artificial Brains – Deep Q-Learning, introduces the fundamentals of deep learning and the theory of the deep Q-learning AI model.
Chapter 10, AI for Autonomous Vehicles – Build a Self-Driving Car, applies the deep Q-learning AI model of Chapter 9 to build a virtual self-driving car.
Chapter 11, AI for Business – Minimize Cost with Deep Q-Learning, applies the deep Q-learning AI model of Chapter 9 to solve a real-world business problem related to cost optimization.
Chapter 12, Deep Convolutional Q-Learning, introduces the fundamentals of convolutional neural networks and the theory of the deep convolutional Q-learning AI model.
Chapter 13, AI for Games – Become the Master at Snake, applies the deep convolutional Q-learning AI model of Chapter 12 to beat the famous Snake video game
Chapter 14, Recap and Conclusion, concludes the book with a recap of how to create an AI framework and some final words from the author about your future in the world of AI.
To get the most out of this book
You don't need to know much before we begin; the book contains refreshers on all the prerequisites needed to understand the AI models. There's also a full chapter on Python fundamentals to help you learn, if you need to, how to code in Python.
There are no required prior installations, since all the practical instructions are provided from scratch in the book. You only need to have your computer ready and switched on.
I recommend you have Google open while reading the book, so that you can visit the links provided in the book as resources, and to check out the math concepts behind the AI models of this book in more detail.
Download the example code files
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at http://www.packtpub.com.
Select the SUPPORT tab.
Click on Code Downloads & Errata.
Enter the name of the book in the Search box and follow the on-screen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR / 7-Zip for Windows
Zipeg / iZip / UnRarX for Mac
7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/AI-Crash-Course. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Download the color images
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://static.packt-cdn.com/downloads/9781838645359_ColorImages.pdf.
Conventions used
There are a number of text conventions used throughout this book.
CodeInText : Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. For example; To get these numbers you can add together the lists nPosReward and nNegReward .
A block of code is set as follows:
# Creating the dataset
X
=
np.zeros((N, d))
for
i in range(N):
for
j in range(d):
if
np.random.rand() < conversionRates[j]:
X[i][j]
=
1
When we wish to draw your attention to a particular line in a code block, we have included the line numbers as comments so that we can refer to them with precision:
self.last_state =
new
_state
#80
self.last_action =
new
_action
#81
self.last_reward =
new
_reward
#82
return
new
_action
#83
Any command-line input or output is written as follows:
conda install -
c
conda-forge keras
Bold: Indicates a new term, an important word, or words that you see on the screen, for example, in menus or dialog boxes, also appear in the text like this. For example: "Select System info from the Administration panel."
Warnings or important notes appear like this.
Tips and tricks appear like this.
Get in touch
Feedback from our readers is always welcome.
General feedback: Email [email protected], and mention the book's title in the subject of your message. If you have questions about any aspect of this book, please email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book we would be grateful if you would report this to us. Please visit, http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit http://authors.packtpub.com.
Reviews
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packtpub.com.
1
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:
Thompson Sampling
Q-learning
Deep Q-learning
Deep convolutional Q-learning
For each of these four models, we will follow the same three-step approach:
Get an intuitive understanding of how it works.
Get all the math behind the theory.
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.
Fundamentals
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