Welcome to AI Programming with Python

Start using AI techniques and developing skills related to programming, linear algebra, and neural networks.

Why Python Programming

Start coding with Python, drawing upon libraries and automation scripts to solve complex problems quickly.

Data Types and Operators

Control Flow

Functions

Scripting

Lab Classifying Images

In this project, learners will be testing their newly-acquired Python coding skills by using a trained image classifier. They will need to use the trained neural network to classify images of dogs (by breeds) and compare the output with the known dog breed classification. Learners will have a chance to build their own functions, use command line arguments, test the runtime of the code, create a dictionary of lists, and more.

NumPy

Learn how to use all the key tools for working with data in Python: Jupyter Notebooks, NumPy, Anaconda, Pandas, and Matplotlib.

Pandas

Matplotlib and Seaborn Part 1

Learn how to use Matplotlib to choose appropriate plots for one and two variables based on the types of data you have.

Matplotlib and Seaborn Part 2

Introduction

Learn the foundational math needed for AI success—vectors, linear transformations, and matrices—as well as the linear algebra behind neural networks.

Vectors

Linear Combination

Linear Transformation and Matrices

Vectors Lab

Linear Combination Lab

Linear Mapping Lab

Linear Algebra in Neural Networks

Introduction to Neural Networks

Gain a solid foundation in the latest trends in AI: neural networks, deep learning, and PyTorch.

Implementing Gradient Descent

Training Neural Networks

Deep Learning with PyTorch

Create Your Own Image Classifier

How Do I Continue From Here

22.3 Lists and Membership Operators

Mutability and Order

Mutability is about whether or not we can change an object once it has been created. If an object (like a list or string) can be changed (like a list can), then it is called mutable. However, if an object cannot be changed with creating a completely new object (like strings), then the object is considered immutable.

>>> my_lst = [1, 2, 3, 4, 5]
>>> my_lst[0] = 'one'
>>> print(my_lst)
['one', 2, 3, 4, 5]

As shown above, you are able to replace 1 with ‘one’ in the above list. This is because lists are mutable.

However, the following does not work:

>>> greeting = "Hello there"
>>> greeting[0] = 'M'

This is because strings are immutable. This means to change this string, you will need to create a completely new string.

There are two things to keep in mind for each of the data types you are using:

  1. Are they mutable?
  2. Are they ordered?

** Order** is about whether the position of an element in the object can be used to access the element. ** Both strings and lists are ordered.** We can use the order to access parts of a list and string.

However, you will see some data types in the next sections that will be unordered. For each of the upcoming data structures you see, it is useful to understand how you index, are they mutable, and are they ordered. Knowing this about the data structure is really useful!

Additionally, you will see how these each have different methods, so why you would use one data structure vs. another is largely dependent on these properties, and what you can easily do with it!