Book Image

AI Crash Course

By : Hadelin de Ponteves
5 (2)
Book Image

AI Crash Course

5 (2)
By: Hadelin de Ponteves

Overview of 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.
Table of Contents (17 chapters)
16
Index

Lists and arrays

Lists and arrays can be represented with a table. Imagine a one-dimensional (1D) vector or a matrix, and you have just imagined a list/array.

Lists and arrays can contain data in them. Data can be anything – variables, other lists or arrays (these are called multi-dimensional lists/arrays), or objects of some classes (we will learn about them later).

For example, this is a 1D list/array containing integers:

And this is an example of a two-dimensional (2D) list/array, also containing integers:

In order to create a 2D list, you have to create a list of lists. Creating a list is very simple, just like this:

L1 = list()
L2 = []
L3 = [3,4,1,6,7,5]
L4 = [[2, 9, -5], [-1, 0, 4], [3, 1, 2]]

Here we create four lists: L1, L2, L3 and L4. The first two lists are empty – they have zero elements. The two subsequent lists have some predefined values in them. L3 is a one-dimensional list, same as the one in the...