Code Resources

View details of code resources by course

Resources by Course

All deeplizard resources are tested and updated to support newer dependency versions, as well as improved with bug fixes. Resources are made available in versioned releases, so you can stay up to date when changes are applied.

  • Tested
  • Maintained
  • Current

Select your course below to see the resources contained in the latest release.

AI Art for Beginners - Stable Diffusion Crash Course

expand_more chevron_left

ai art for beginners v1.0.0

Files

Files included in this release:

Download zipped files here.
# Name Size
1 add-labels-to-empty.ps1 1.0 KB
2 add-lables.ps1 909.0 b
3 create-video.ps1 438.0 b
4 deeplizard-colab-automatic1111-ui.ipynb.ipynb 6.9 KB
5 empty-4k.png 31.6 KB
6 ffmpeg-5.1.2-essentials_build.zip 79.0 MB
7 groups.json 76.7 KB
8 source.jpg 54.0 KB
9 stable-diffusion-webui.zip 1.4 MB
10 mask-01.jpg 5.0 KB
11 mask-02.jpg 4.6 KB
12 mask-03.jpg 6.2 KB
13 mask-04.jpg 7.6 KB
Changes

Changes included in this release:

e49efa0
Add ai-art-for-beginners

Committed by chris on March 19, 2023

Deep Learning Dictionary - Lightweight Crash Course

expand_more chevron_left

There is no additional downloadable content for this course.

Deep Learning Fundamentals - Premium Edition

expand_more chevron_left

There is no additional downloadable content for this course.

TensorFlow - Python Deep Learning Neural Network API

expand_more chevron_left

Deep Learning with TensorFlow v1.0.5

Files

Files included in this release:

Download zipped files here.
# Name Size
1 Part-1-tf.Keras-deeplizard.ipynbpassing 4.9 MB
2 versions.ipynbpassing 1.8 KB
3 medical_trial_model.h5 31.8 KB
4 my_model_weights.h5 17.5 KB
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.8.13
tensorflow 2.9.1
numpy 1.22.4
sklearn 1.1.1
Changes

Changes included in this release:

7b2f91d
Get and store the output from the fifth-to-last layer of MobileNet model, rather than sixth-to-last.
In a later version of TensorFlow, a new parameter was introduced to the GlobalAveragePooling2D layer. This is the last layer that we grab from the original MobileNet model when constructing our fine-tuned version.The new optional parameter for this layer is called keepdims. When it is set to True, the output shape of the layer will keep the same number of dimensions from the previous layer. In the MobileNet model, the newer version of TensorFlow sets this parameter to True for the GlobalAveragePooling2D layer by default, causing a difference in the output shape shown in the corresponding video. The new version is keeping the output of this layer as (None, 1, 1, 1024), whereas the old version had a Reshape layer following the pooling layer to reshape the output to (None, 1024). Therefore, we must reshape the output ourselves before passing to the output layer, as a Reshape layer is no longer included following the GlobalAveragePooling2D layer. Failing to do this will result in the following error: ValueError: functional api Shapes (None, None) and (None, 7, 7, 10) are incompatible

Committed by Mandy on July 17, 2022

c386f87
Separate model deployment code into new build
Removes Flask and TensorFlow.js deployment projects from this course and places them into their own build for the Deep Learning Deployment Basics course.

Committed by Mandy on February 27, 2022

a5dfd5a
Add MobileNet TensorFlow.js model files

Committed by Mandy on December 2, 2020

02e72cc
Upgrade and verify code for TensorFlow.js version 2.2.0

Committed by Mandy on December 2, 2020

263fd00
Upgrade and verify code for TensorFlow version 2.3.1
Now tested against TensorFlow 2.3.1

Committed by Mandy on December 2, 2020

d65e982
Upgrade and verify code for TensorFlow version 2.2.0
Now tested against TensorFlow 2.2.0

Committed by Mandy on July 15, 2020

48e2699
Update Flask code to use tf.keras

Committed by Mandy on July 15, 2020

d8c793e
General formatting and refactoring updates

Committed by Mandy on July 10, 2020

75a61c0
Update dogs-vs-cats data set
Use larger data set organized by new script in notebook

Committed by Mandy on July 4, 2020

49acc4c
Consolidate notebooks
Move MobileNet code into Part-1-tf.keras-deeplizard.ipynb notebook

Committed by Mandy on July 1, 2020

9937c62
Update Keras notebooks to use tf.keras code

Committed by Mandy on May 27, 2020

f9f1534
Round predictions before passing them to sckit-learn's confusion_matrix
When plotting a confusion matrix using sckit-learn's plot_confusion_matrix, the following error would occur: Classification metrics can't handle a mix of binary and continuous targets Rounding predictions before plotting resolves this issue. https://deeplizard.com/learn/video/HDom7mAxCdc

Committed by Mandy on April 1, 2020

099fcf7
Change the way in which the fine-tuned VGG16 model is built
Previously, we iterated over the original VGG16 model and added all layers to the new model. Then, we would pop off the output layer and add our own output layer. Using pop in this way causes subseqent issues with saving and loading the fine-tuned model, as well as showing an incorrect number of trainable parameters when calling model.summary(). To avoid using pop, when iterating over the original VGG16 model, we add all layers except for the output to the new model. Then add the new output layer. Full explanation can be found here: https://deeplizard.com/learn/video/oDHpqu52soI

Committed by Mandy on June 13, 2019

60e3974
Change order in which training data is generated for simple Keras Sequential model
Two for loops were previously generating the data in such a way that, when we use the validation_split option to create the valdiation set, the validation_split would completely capture all of the data in the second for loop. Therefore, none of the data in the second for loop would be captured in the training set since it would all be split out into the validation set. Changing the order of the two for loops mitigates this issue. Full explanation can be found here: https://deeplizard.com/learn/video/dzoh8cfnvnI

Committed by Mandy on November 22, 2017

d29b099
Create course
Course Name: Keras - Python Deep Learning Neural Network API Description: This series will teach you how to use Keras, a neural network API written in Python. Each video focuses on a specific concept and shows how the full implementation is done in code using Keras and Python. We will learn how to preprocess data, organize data for training, build and train an artificial neural network from scratch, build and fine-tune convolutional neural networks (CNNs), implement fine-tuning and transfer learning, deploy our models using both front-end and back-end deployment techniques, and much more!

Committed by Mandy on November 18, 2017

PyTorch - Python Deep Learning Neural Network API

expand_more chevron_left

Deep Learning with PyTorch v1.0.3

Files

Files included in this release:

Download zipped files here.
# Name Size
1 debug-data-normalization.py 535.0 b
2 debug-how-to-example.py 315.0 b
3 deeplizard-condensed-code-fashion-mnist-project.ipynbpassing 73.1 KB
4 network.pt 1.0 KB
5 Part-1_Neural-Network-Programming_deeplizard.ipynbpassing 83.4 KB
6 Part-2_Neural-Network-Programming_deeplizard.ipynbpassing 279.5 KB
7 versions.ipynbpassing 1.9 KB
8 plotcm.py 1.2 KB
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.6.5
torch 1.10.2
torchvision 0.11.3
tensorflow 2.0.0-rc1
tensorboard 1.15.0a20190806
pandas 1.0.1
numpy 1.19.2
Changes

Changes included in this release:

79d7446
Add final lessons of the course

Committed by Chris on February 16, 2022

bbabcb4
Upgrade to PyTorch 1.10.2 and torchvision 0.11.3
Code verified successfully with new versions of torch and torchvision.

Committed by Chris on February 11, 2022

6fda40c
Add info about weight init issue in run loop

Committed by Chris on February 8, 2022

197f8ab
Upgrade to PyTorch 1.7.0 and torchvision 0.8.1
Code verified successfully with new versions of torch and torchvision.

Committed by Chris on November 23, 2020

e246083
Add a new definition for the RunManager class to keep original code backwards compatible
Update code to remove the comment argument passed to the SummaryWriter constructor. Adding more parameters to the comment caused the file name to grow too large in size. Removed: self.tb = SummaryWriter(comment=f'-{run}') Added: self.tb = SummaryWriter()

Committed by Chris on June 10, 2020

c24b4c8
Add py files for the debugger videos
Adds the following files: debug-data-normalization.py debug-how-to-example.py

Committed by Chris on June 10, 2020

461dbc7
Add code for the Sequential class video

Committed by Chris on June 10, 2020

00e2528
Apply refactor updates recommended by David from the hivemind

Committed by Chris on May 24, 2020

871f0e2
General formatting and refactoring updates

Committed by Chris on May 23, 2020

0547f9e
Remove hard coded variable of class names and replace with train_set.classes

Committed by Chris on May 22, 2020

7e232fd
Upgrade and verify code for PyTorch (1.5) and Torchvision (0.6.0)
Now tested against: PyTorch 1.5 Torchvision 0.6.0

Committed by Chris on May 19, 2020

b7eee0d
Add code for cuda demonstration

Committed by Chris on May 5, 2020

06e73ee
Create PyTorch build 1.0.0

Committed by Chris on April 19, 2020

acacec9
Enhance calculation of total_loss when training set size is not divisible by batch_size
Currently, we have the following: total_loss += loss.item() * batch_size Using the updated code below, we can achieve a more accurate total_loss value: total_loss += loss.item() * images.shape[0] Note that these two lines of code give us the same total_loss value when the training set size is divisible by the batch_size. Thank you to Alireza Abedin Varamin for pointing this out in a comment on YouTube. Further discussion can be found here: https://deeplizard.com/learn/video/ycxulUVoNbk

Committed by Chris on December 9, 2019

faafcd4
Remove call to np.transpose in favor of torch.permute

Committed by Chris on June 8, 2019

989f104
Comparison operations returned dtype change in PyTorch 1.2.0
Behavior Change in PyTorch Version 1.2.0 Comparison operations returned dtype has changed from torch.uint8 to torch.bool (21113). Version 1.1: > torch.tensor([1, 2, 3]) < torch.tensor([3, 1, 2]) tensor([1, 0, 0], dtype=torch.uint8) Version 1.2: > torch.tensor([1, 2, 3]) < torch.tensor([3, 1, 2]) tensor([True, False, False]) Release Notes: https://github.com/pytorch/pytorch/releases/tag/v1.2.0 Pull Request: https://github.com/pytorch/pytorch/pull/21113

Committed by Chris on May 3, 2019

609b6d2
Rename train_labels to targets for MNIST dataset in torchvision v0.2.2
Change in torchvision: Add deprecation warning in MNIST train[test]_labels[data] Link: https://github.com/pytorch/vision/pull/742 Before torchvision 0.2.2, we would write: > train_set.train_labels tensor([9, 0, 0, ..., 3, 0, 5]) Starting with and after torchvision 0.2.2, we write: > train_set.targets tensor([9, 0, 0, ..., 3, 0, 5])

Committed by Chris on February 13, 2019

b7f5ee2
Create course
Course Name: Neural Network Programming - Deep Learning with PyTorch Description: This series is all about neural network programming and PyTorch! We'll start out with the basics of PyTorch and CUDA and understand why neural networks use GPUs. We then move on to cover the tensor fundamentals needed for understanding deep learning before we dive into neural network architecture. From there, we'll go through the details of training a network, analyzing results, tuning hyperparameters, and using TensorBoard with PyTorch for visual analytics!

Committed by Chris on November 18, 2018

NLP Intro for Text - Sentiment Analysis with Deep Learning

expand_more chevron_left

Sentiment Analysis with Deep Learning v1.0.1

Files

Files included in this release:

Download zipped files here.
# Name Size
1 PyTorch-N-Gram-Model-Sentiment-Analysis-Deeplizard.ipynbpassing 118.3 KB
2 PyTorch-Sequence-Model-Sentiment-Analysis-Deeplizard.ipynbpassing 102.1 KB
3 TensorFlow-N-Gram-Model-Sentiment-Analysis-Deeplizard.ipynbpassing 1.1 MB
4 TensorFlow-Sequence-Model-Sentiment-Analysis-Deeplizard.ipynbpassing 84.1 KB
5 versions.ipynbpassing 2.2 KB
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.10.12
torch 2.0.1+cu118
torchtext 0.15.2+cpu
torchdata 0.6.1
tensorflow 2.12.0
sklearn 1.2.2
portalocker 2.7.0
Changes

Changes included in this release:

0ed7d37
Change PyTorch IMDB labels from neg and pos to 1 and 2 to accomodate later torchtext versions. Also import portalocker, as this library is now needed in later torchtext versions as well.

Committed by Mandy on August 30, 2023

e90968c
Create course code

Committed by Mandy on August 11, 2022

Reinforcement Learning - Developing Intelligent Agents

expand_more chevron_left

Reinforcement Learning v1.0.2

Files

Files included in this release:

Download zipped files here.
# Name Size
1 Part-1-Q-learning-Frozen-Lake-deeplizard.ipynbpassing 9.6 KB
2 Part-2-Cart-and-Pole-DQN-deeplizard.ipynbpassing 148.2 KB
3 Part-2-Cart-and-Pole-DQN-SOLVED-with-state-input-changes-deeplizard.ipynbpassing 104.8 KB
4 versions.ipynbpassing 1.8 KB
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.8.13
numpy 1.22.4
gymnasium 0.26.3
torch 1.12.1
torchvision 0.13.1
Changes

Changes included in this release:

71be2a5
Update code to switch from Gym to latest Gymnasium version 0.26.3
The team that has been maintaining Gym has moved all future development to Gymnasium, a drop in replacement for Gym (import gymnasium as gym). The original Gym repo isn't planned to receive any future updates. All future updates to the API will be in the Gymnasium repo. Please install Gymnasium with the command below and import gymnasium as gym. The code for this course has been updated to use Gymnasium, which includes several modifications. pip install gymnasium Reference: https://github.com/openai/gym#important-notice

Committed by Mandy on November 11, 2022

67b29fe
Add new notebook with code updates to solve Cart and Pole
Change the code to use state inputs returned by Gym environment, rather than image data to solve the Cart and Pole environment

Committed by Mandy on February 26, 2022

1711e79
Fix for calling plt.imshow() on a GPU
When using a GPU, calling plt.imshow(screen.squeeze(0).permute(1, 2, 0), interpolation='none') to plot an image generates the following error: TypeError: can't convert CUDA tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. Calling cpu() on permute() resolves this issue. plt.imshow(screen.squeeze(0).permute(1, 2, 0).cpu(), interpolation='none') https://deeplizard.com/learn/video/jkdXDinWfo8

Committed by Mandy on August 10, 2019

d29b099
Create course
Course Name: Reinforcement Learning - Goal Oriented Intelligence Description: This series is all about reinforcement learning (RL)! Here, we'll gain an understanding of the intuition, the math, and the coding involved with RL. We'll first start out with an introduction to RL where we'll learn about Markov Decision Processes (MDPs) and Q-learning. We'll then move on to deep RL where we'll learn about deep Q-networks (DQNs) and policy gradients. We'll also build some cool RL projects in code using Python, PyTorch, and OpenAI Gym.

Committed by Mandy on September 15, 2018

Generative Adversarial Networks - GANs Intro

expand_more chevron_left

Introduction to GANs v1.0.0

Files

Files included in this release:

Download zipped files here.
# Name Size
1 GAN-Course-Code-Demos-deeplizard.ipynbpassing 68.2 KB
2 PyTorch-DCGAN-deeplizard.ipynbpassing 10.0 MB
3 TensorFlow-DCGAN-deeplizard.ipynbpassing 9.2 MB
4 versions.ipynbpassing 2.2 KB
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.6.10
torch 1.9.0
torchvision 0.10.0
tensorflow 2.5.0
numpy 1.17.0
pandas 1.1.2
tqdm 4.61.1
graphviz 0.16
torchviz 0.0.2
cv2 3.4.5
Changes

Changes included in this release:

e39575d
Add instructions for Google Colab setup

Committed by Mandy on July 5, 2021

ba878ee
Organize GAN course directory

Committed by Mandy on August 5, 2020

Stable Diffusion Masterclass - Theory, Code & Application

expand_more chevron_left

Stable Diffusion Masterclass v1.0.0

Files

Files included in this release:

Download zipped files here.
# Name Size
1 versions.ipynbpassing 2.1 KB
2 versions.json 507.0 b
3 deeplizard-diffusers.ipynbpassing 14.4 MB
4 lora_config.json 3.2 KB
5 lora_train_script.txt 1.2 KB
6 readme.txt 101.0 b
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.10.6
torch 2.0.1
transformers 4.33.2
diffusers 0.21.2
accelerate 0.23.0
scipy 1.11.2
ftfy 6.1.1
Changes

Changes included in this release:

9baa0a1
Add SD Masterclass download resources

Committed by Mandy on September 24, 2023

Deep Learning Deployment Basics - Neural Network Web Apps

expand_more chevron_left

Deep Learning Deployment Basics v1.0.0

Files

Files included in this release:

Download zipped files here.
# Name Size
1 versions.ipynbpassing 1.5 KB
2 hello_app.py 330.0 b
3 predict_app.py 1.3 KB
4 README.txt 149.0 b
5 sample_app.py 121.0 b
6 hello.html 783.0 b
7 predict-with-visuals.html 2.8 KB
8 predict.html 1.6 KB
9 Observable-notebook.txt 139.0 b
10 package-lock.json 14.3 KB
11 package.json 107.0 b
12 server.js 304.0 b
13 imagenet_classes.js 32.8 KB
14 predict-with-tfjs.html 2.2 KB
15 predict.js 2.1 KB
16 group1-shard1of5.bin 4.0 MB
17 group1-shard2of5.bin 4.0 MB
18 group1-shard3of5.bin 4.0 MB
19 group1-shard4of5.bin 4.0 MB
20 group1-shard5of5.bin 232.7 KB
21 model.json 52.7 KB
22 README.txt 299.0 b
Dependencies

Dependencies used in this release:

Code files were tested using these versions.
Name Version
python 3.6.10
tensorflow 2.5.0
flask 1.1.2
numpy 1.17.0
Changes

Changes included in this release:

575c86e
Create new build for Deep Learning Deployment Basics course
Separates model deployment code from TensorFlow course code

Committed by Mandy on February 27, 2022