Welcome to AI Programming with Python
Start using AI techniques and developing skills related to programming, linear algebra, and neural networks.
03. Deadline Policy
04. Support
05. Community Guidelines
06. Lesson Plan
Setting up your environment
Why Python Programming
Start coding with Python, drawing upon libraries and automation scripts to solve complex problems quickly.
Data Types and Operators
03.2 Quiz: Arithmetic Operators
06.2 Quiz: Variables and Assignment Operators
07. Solution: Variables and Assignment Operators
08. Integers and Floats3:54
08.2 Integers and Floats2:24
09. Quiz: Integers and Floats
09. Quiz: Integers and Floats
10. Booleans, Comparison Operators, and Logical Operators2:29
11. Quiz: Booleans, Comparison Operators, and Logical Operators
11. Quiz: Booleans, Comparison Operators, and Logical Operators
12. Solution: Booleans, Comparison and Logical Operators
13. Strings4:20
14. Quiz: Strings
14. Quiz: Strings
14.2 Quiz: Strings
14.3 Quiz: Strings
14.3 Quiz: Strings
15. Solution: Strings
16. Type and Type Conversion2:29
17. Quiz: Type and Type Conversion
17. Quiz: Type and Type Conversion
18. Solution: Type and Type Conversion
19. String Methods2:43
20. String Methods
20. String Methods
20.2 String Methods
21. Another String Method – Split
22. Lists and Membership Operators3:04
22.2 Lists and Membership Operators2:11
22.3 Lists and Membership Operators2:11
23. Quiz: Lists and Membership Operators
23. Quiz: Lists and Membership Operators
23.2 Quiz: Lists and Membership Operators
24. Solution: List and Membership Operators
25. List Methods00:00
25.2 List Methods00:00
26. Quiz: List Methods
26. Quiz: List Methods
27. Tuples00:00
28. Quiz: Tuples
28. Quiz: Tuples
29. Sets1:41
30. Quiz: Sets
30. Quiz: Sets
31. Dictionaries and Identity Operators00:00
32. Quiz: Dictionaries and Identity Operators
33. Solution: Dictionaries and Identity Operators
32.2 Quiz: Dictionaries and Identity Operators
32. Quiz: Dictionaries and Identity Operators
34. Quiz: More With Dictionaries
34. Quiz: More With Dictionaries
34.2 Quiz: More With Dictionaries
34.2: Solution. More With Dictionaries
35. Compound Data Structures0:56
36. Quiz: Compound Data Structures
36. Quiz: Compound Data Structures
37. Solution: Compound Data Structions
38. Conclusion00:00
39. Summary
Control Flow
01. Introduction0:40
02. Conditional Statements2:13
02.2 Conditional Statements2:03
02.3 Conditional Statements0:53
02.4 Conditional Statements Practice
03. Practice: Conditional Statements
04. Solution: Conditional Statements
05. Quiz: Conditional Statements
05.2 Quiz: Conditional Statements
06. Solution: Conditional Statements
07. Boolean Expressions for Conditions00:00
07.2 Boolean Expressions for Conditions00:00
07.3 Boolean Expressions for Conditions00:00
08. Quiz: Boolean Expressions for Conditions
09. Solution: Boolean Expressions for Conditions
10. For Loops00:00
11. Practice: For Loops
11.2 Practice: For Loops
12. Solution: For Loops Practice
13. Quiz: For Loops
13. Quiz: For Loops
13.2 Quiz: For Loops
13.3 Quiz: For Loops
13.4 Quiz: For Loops
14. Solution: For Loops Quiz
15. Quiz: Match Inputs To Outputs
15. Quiz: Match Inputs To Outputs
16. Building Dictionaries
17. Iterating Through Dictionaries with For Loops
17.2 Iterating Through Dictionaries with For Loops
18. Quiz: Iterating Through Dictionaries
18.2 Quiz: Iterating Through Dictionaries
18.3 Quiz: Iterating Through Dictionaries
19. Solution: Iterating Through Dictionaries
20. While Loops00:00
21. Practice: While Loops
21.2 Practice: While Loops
22. Solution: While Loops Practice
23. Quiz: While Loops
23.2 Quiz: While Loops
23.3 Quiz: While Loops
24. Solution: While Loops Quiz
25. Break, Continue00:00
25.2 Break, Continue
26. Quiz: Break, Continue
27. Solution: Break, Continue
28. Zip and Enumerate
29. Quiz: Zip and Enumerate
29.2 Quiz: Zip and Enumerate
29.3 Quiz: Zip and Enumerate
29.4 Quiz: Zip and Enumerate
29.5 Quiz: Zip and Enumerate
30. Solution: Zip and Enumerate
31. List Comprehensions00:00
32. Quiz: List Comprehensions
32.2 Quiz: List Comprehensions
32.3 Quiz: List Comprehensions
33. Solution: List Comprehensions
34. Conclusion00:00
Functions
01. Introduction1:00
02. Defining Functions4:04
02. Defining Functions
02.2 Defining Functions
02.3 Defining Functions1:34
03. Quiz: Defining Functions
03.2 Quiz: Defining Functions
04. Solution: Defining Functions
05. Variable Scope1:02
06. Variable Scope
07. Solution: Variable Scope
08. Documentation2:06
09. Quiz: Documentation
10. Solution: Documentation
11. Lambda Expressions00:00
12. Quiz: Lambda Expressions
12.2 Quiz: Lambda Expressions
13. Solution: Lambda Expressions
14. [Optional] Iterators and Generators00:00
15. [Optional] Quiz: Iterators and Generators
15.2 [Optional] Quiz: Iterators and Generators
16. [Optional] Solution: Iterators and Generators
17. [Optional] Generator Expressions
18. Conclusion00:00
19. Further Learning
Scripting
01. Introduction0:29
02. Python Installation
03. Install Python Using Anaconda
04. [For Windows] Configuring Git Bash to Run Python
05. Running a Python Script00:00
06. Programming Environment Setup00:00
07. Editing a Python Script
07. Editing a Python Script
08. Scripting with Raw Input
09. Quiz: Scripting with Raw Input
10. Solution: Scripting with Raw Input
11. Errors and Exceptions1:57
12. Errors and Exceptions
13. Handling Errors1:33
13.2 Handling Errors00:00
14. Practice: Handling Input Errors
15. Solution: Handling Input Errors
16. Accessing Error Messages
17. Reading and Writing Files00:00
17.2 Reading and Writing Files00:00
17.3 Reading and Writing Files00:00
18. Quiz: Reading and Writing Files
18.2 Quiz: Reading and Writing Files
19. Solution: Reading and Writing Files
20. Importing Local Scripts00:00
21. The Standard Library00:00
22. Quiz: The Standard Library
22.2 Quiz: The Standard Library
22.2 Quiz: The Standard Library
23. Solution: The Standard Library
24. Techniques for Importing Modules00:00
24.2 Techniques for Importing Modules00:00
25. Quiz: Techniques for Importing Modules
26. Third-Party Libraries00:00
27. Experimenting with an Interpreter00:00
28. Online Resources
28. Online Resources
28.2 Online Resources
29. Conclusion00:00
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.
01. Instructor
02. Lab Description
03. Lab Instructions1:40
04. Workspace How-to5:09
05. Workspaces: Best Practices
06. Lab Workspace
07. Timing Code
07.2 Timing Code2:06
08. Command Line Arguments3:06
08.2 Command Line Arguments
09. Mutable Data Types and Functions00:00
10. Creating Pet Image Labels – Part 1
11. Creating Pet Image Labels – Part 2
11.2 Creating Pet Image Labels – Part 200:00
12. Classifying Images – Part 1
13. Classifying Images – Part 2
13.2 Classifying Images – Part 200:00
14. Classifying Labels as Dogs
14.2 Classifying Labels as Dogs00:00
15. Calculating Results
15.2 Calculating Results00:00
16. Printing Results
16.2 Printing Results00:00
17. Results
18. Concluding Remarks
19. Lab Solution Workspace
NumPy
Learn how to use all the key tools for working with data in Python: Jupyter Notebooks, NumPy, Anaconda, Pandas,
and Matplotlib.
01. Instructors
02. Introduction to NumPy
03. Why Use NumPy?3:08
04. Creating and Saving NumPy ndarrays00:00
05. Using Built-in Functions to Create ndarrays00:00
06. Create an ndarray
06. Solution. Create an ndarray
07. Accessing, Deleting, and Inserting Elements Into ndarrays00:00
08. Slicing ndarrays6:24
09. Boolean Indexing, Set Operations, and Sorting3:14
10. Manipulating ndarrays
10. Solution. Manipulating ndarrays
11. Arithmetic operations and Broadcasting00:00
12. Creating ndarrays with Broadcasting
12. Solution. Creating ndarrays with Broadcasting
13. Getting Set Up for the Mini-Project
14. Mini-Project: Mean Normalization and Data Separation
Pandas
01. Instructors
02. Introduction to Pandas
03. Why Use Pandas?
04. Creating Pandas Series2:28
05. Accessing and Deleting Elements in Pandas Series2:34
06. Arithmetic Operations on Pandas Series2:11
07. Manipulate a Series
07. Solution. Manipulate a Series
08. Creating Pandas DataFrames00:00
09. Accessing Elements in Pandas DataFrames00:00
10. Dealing with NaN00:00
11. Manipulate a DataFrame
11. Solution. Manipulate a DataFrame
12. Loading Data into a Pandas DataFrame4:06
13. Getting Set Up for the Mini-Project
14. Mini-Project: Statistics From Stock Data
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.
01. Instructor
03. Tidy Data
04. Bar Charts2:28
04.2 Bar Charts4:13
05. Absolute vs. Relative Frequency1:04
05.2 Absolute vs. Relative Frequency00:00
06. Counting Missing Data
07. Bar Chart Practice
08. Pie Charts00:00
09. Histograms00:00
09.2 Histograms00:00
10. Histogram Practice
11. Figures, Axes, and Subplots
11. Figures, Axes, and Subplots
11.2 Figures, Axes, and Subplots
12. Choosing a Plot for Discrete Data
13. Descriptive Statistics, Outliers and Axis Limits00:00
13.2 Descriptive Statistics, Outliers and Axis Limits00:00
14. Scales and Transformations00:00
14.2 Scales and Transformations00:00
15. Scales and Transformations Practice
16. Lesson Summary00:00
17. Extra Kernel Density Estimation
Matplotlib and Seaborn Part 2
02. Scatterplots and Correlation2:38
02.2 Scatterplots and Correlation00:00
03. Overplotting, Transparency, and Jitter00:00
03.2 Overplotting, Transparency, and Jitter00:00
04. Heat Maps00:00
04.2 Heat Maps00:00
05. Scatterplot Practice
06. Violin Plots00:00
06.2 Violin Plots00:00
07. Box Plots00:00
07.2 Box Plots00:00
08. Violin and Box Plot Practice
09. Clustered Bar Charts00:00
09.2 Clustered Bar Charts00:00
10. Categorical Plot Practice
11. Faceting00:00
11.2 Faceting00:00
12. Adaptation of Univariate Plots00:00
12.2 Adaptation of Univariate Plots00:00
13. Line Plots00:00
13.2 Line Plots00:00
14. Additional Plot Practice
15. Lesson Summary00:00
16. Postscript Multivariate Visualization
17. Extra Swarm Plots
18. Extra Rug and Strip Plots
Introduction
Learn the foundational math needed for AI success—vectors, linear transformations, and matrices—as well as the linear algebra behind neural networks.
01. Our Goal
02. Instructors
03. Essence of Linear Algebra4:26
04. Structure of this lesson
05. Working with Equations
06. Try our workspace out!00:00
07. Try our workspace again!00:00
Vectors
02. Vectors, what even are they Part 21:44
03. Vectors, what even are they Part 34:05
04. Vectors- Mathematical definition
05. Transpose
06. Magnitude and Direction
07. Vectors- Quiz 1
08. Operations in the Field
09. Vector Addition
10. Vectors- Quiz 2
11. Scalar by Vector Multiplication
12. Vectors Quiz 3
13. Vectors Quiz Answers
Linear Combination
01. Linear Combination. Part 100:00
02. Linear Combination. Part 200:00
03. Linear Combination and Span
04. Linear Combination -Quiz 1
05. Linear Dependency
06. Solving a Simplified Set of Equations
07. Linear Combination – Quiz 2
08. Linear Combination – Quiz 3
Linear Transformation and Matrices
01. What is a Matrix
02. Matrix Addition
03. Matrix Addition Quiz
04. Scalar Multiplication of Matrix and Quiz
05. Multiplication of a Square Matrices
06. Square Matrix Multiplication Quiz
07. Matrix Multiplication – General
08. Matrix Multiplication Quiz
09. Linear Transformation and Matrices . Part 100:00
10. Linear Transformation and Matrices. Part 200:00
11. Linear Transformation and Matrices. Part 300:00
12. Linear Transformation Quiz Answers
Vectors Lab
01. Vectors Lab
02. Vectors Lab Solution00:00
02.2 Vectors Lab Solution00:00
Linear Combination Lab
01. Linear Combination
02. Linear Combination Lab Solution00:00
Linear Mapping Lab
01. Lab Description
02. Visualizing Matrix Multiplication
03. Matrix Multiplication Lab
04. Linear Mapping Lab Solution1:17
04.2 Linear Mapping Lab Solution00:00
04.3 Linear Mapping Lab Solution00:00
Linear Algebra in Neural Networks
01. Instructor
02. Brief Introduction
03. What is a Neural Network0:30
04. How Are The Neurons Connected
05. Putting The Pieces Together00:00
06. The Feedforward Process- Finding h00:00
07. The Feedforward Process- Finding y00:00
Introduction to Neural Networks
Gain a solid foundation in the latest trends in AI: neural networks, deep learning, and PyTorch.
01. Instructor
02. Introduction1:54
03. Classification Problems 11:38
03. Classification Problems 1
04. Classification Problems 21:04
05. Linear Boundaries2:43
05. Linear Boundaries
06. Higher Dimensions2:01
06. Higher Dimensions
07. Perceptrons00:00
07. Perceptrons
08. Why Neural Networks00:00
09. Perceptrons as Logical Operators00:00
09. Perceptrons as Logical Operators Lab
09.2 Perceptrons as Logical Operators00:00
09.2 Perceptrons as Logical Operators Lab
09.2 Perceptrons as Logical Operators Lab
09.3 Perceptrons as Logical Operators Lab
09.4 Perceptrons as Logical Operators00:00
09.5 Perceptrons as Logical Operators
09.5 Perceptrons as Logical Operators
10. Perceptron Trick00:00
10. Perceptron Trick
10.2 Perceptron Trick0:13
10.3 Perceptron Trick2:59
10.3 Perceptron Trick
11. Perceptron Algorithm00:00
11. Perceptron Algorithm Lab
12. Non-Linear Regions00:00
13. Error Functions00:00
14. Log-loss Error Function00:00
14. Log-loss Error Function
15. Discrete vs Continuous00:00
15.2 Discrete vs Continuous00:00
15.2 Discrete vs Continuous
16. Softmax00:00
16.2 Softmax00:00
16.2 Softmax
16.3 Softmax00:00
16.3 Softmax
16.3 Solution. Softmax
17. One-Hot Encoding00:00
18. Maximum Likelihood00:00
18.2 Maximum Likelihood00:00
18.2 Maximum Likelihood
19. Maximizing Probabilities00:00
19.2 Maximizing Probabilities00:00
19.2 Maximizing Probabilities
20. Cross-Entropy 100:00
21. Cross-Entropy 200:00
21.2 Cross-Entropy 200:00
21.2 Cross-Entropy 2 Lab
21.2 Solution. Cross-Entropy 2 Lab
22. Multi-Class Cross Entropy00:00
22. Multi-Class Cross Entropy
23. Logistic Regression00:00
23.2 Logistic Regression00:00
24. Gradient Descent00:00
24.2 Gradient Descent
24.3 Gradient Descent
25. Logistic Regression Algorithm00:00
26. Pre-Lab Gradient Descent
27. Notebook Gradient Descent
28. Perceptron vs Gradient Descent00:00
29. Continuous Perceptrons00:00
30. Non-linear Data00:00
31. Non-Linear Models00:00
32. Neural Network Architecture00:00
32.2 Neural Network Architecture00:00
32.3 Neural Network Architecture00:00
32.4 Neural Network Architecture00:00
33. Feedforward00:00
33.2 Feedforward00:00
32.2 Neural Network Architecture
34. Backpropagation00:00
34.2 Backpropagation00:00
34.3 Backpropagation00:00
34.4 Backpropagation00:00
35. Pre-Lab Analyzing Student Data
36. Notebook Analyzing Student Data
37. Outro
Implementing Gradient Descent
01. Mean Squared Error Function
02. Gradient Descent00:00
03. Gradient Descent The Math7:36
04. Gradient Descent The Code
04. Solution. Gradient Descent The Code
05. Implementing Gradient Descent
06. Multilayer Perceptrons00:00
06. Multilayer Perceptrons Lab
07. Backpropagation00:00
07. Backpropagation Lab
08. Implementing Backpropagation
08. Implementing Backpropagation Lab
09. Further Reading
06. Solution. Multilayer Perceptrons Lab
07. Solution. Backpropagation Lab
Training Neural Networks
01. Instructor
02. Training Optimization00:00
03. Testing00:00
04. Overfitting and Underfitting00:00
05. Early Stopping00:00
06. Regularization00:00
06. Regularization
07. Regularization 200:00
08. Dropout00:00
09. Local Minima00:00
10. Random Restart00:00
11. Vanishing Gradient00:00
12. Other Activation Functions00:00
13. Batch vs Stochastic Gradient Descent00:00
14. Learning Rate Decay00:00
15. Momentum00:00
16. Error Functions Around the World00:00
Deep Learning with PyTorch
01. Instructor
02. Introducing PyTorch
03. PyTorch Tensors7:32
04. Defining Networks17:18
05. Training Networks00:00
06. Fashion-MNIST Exercise1:25
07. Inference Validation13:03
08. Saving and Loading Trained Networks00:00
09. Loading Data Sets with Torchvision00:00
10. Transfer Learning00:00
11. Transfer Learning Solution
Create Your Own Image Classifier
01. Instructor
02. Project Intro0:47
03. Introduction to GPU Workspaces
04. Updating to PyTorch
05. Image Classifier – Part 1 – Development
06. Image Classifier – Part 1 – Workspace
07. Image Classifier – Part 2 – Command Line App
08. Image Classifier – Part 2 – Workspace
09. Rubric
Project Description – Create Your Own Image Classifier
Project Rubric – Create Your Own Image Classifier
How Do I Continue From Here
01. Next Steps into the AI World!00:00
04. Solution: Arithmetic Operators
Here are our solutions to the Arithmetic Operators quiz questions on the previous page:
Solution: Average Electricity Bill
# Write an expression that calculates the average of 23, 32 and 64.
# Place the expression in this print statement.
print((23 + 32 + 64)/3)
Solution: Calculate
# Fill this in with an expression that calculates how many tiles are needed.
print(9*7 + 5*7)
# Fill this in with an expression that calculates how many tiles will be left over.
print(17*6 - (9*7 + 5*7))