• Stars
    star
    1,700
  • Rank 26,347 (Top 0.6 %)
  • Language
    Python
  • License
    MIT License
  • Created about 6 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Advanced Deep Learning with Keras, published by Packt

Advanced Deep Learning with TensorFlow 2 and Keras (Updated for 2nd Edition)

This is the code repository for Advanced Deep Learning with TensorFlow 2 and Keras, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

Please note that the code examples have been updated to support TensorFlow 2.0 Keras API only.

About the Book

Advanced Deep Learning with TensorFlow 2 and Keras, Second Edition is a completely updated edition of the bestselling guide to the advanced deep learning techniques available today. Revised for TensorFlow 2.x, this edition introduces you to the practical side of deep learning with new chapters on unsupervised learning using mutual information, object detection (SSD), and semantic segmentation (FCN and PSPNet), further allowing you to create your own cutting-edge AI projects.

Using Keras as an open-source deep learning library, the book features hands-on projects that show you how to create more effective AI with the most up-to-date techniques.

Starting with an overview of multi-layer perceptrons (MLPs), convolutional neural networks (CNNs), and recurrent neural networks (RNNs), the book then introduces more cutting-edge techniques as you explore deep neural network architectures, including ResNet and DenseNet, and how to create autoencoders. You will then learn about GANs, and how they can unlock new levels of AI performance.

Next, you’ll discover how a variational autoencoder (VAE) is implemented, and how GANs and VAEs have the generative power to synthesize data that can be extremely convincing to humans. You'll also learn to implement DRL such as Deep Q-Learning and Policy Gradient Methods, which are critical to many modern results in AI.

Related Products

Installation

It is recommended to run within conda environment. Pls download Anacoda from: Anaconda. To install anaconda:

sh <name-of-downloaded-Anaconda3-installer>

A machine with at least 1 NVIDIA GPU (1060 or better) is required. The code examples have been tested on 1060, 1080Ti, RTX 2080Ti, V100, RTX Quadro 8000 on Ubuntu 18.04 LTS. Below is a rough guide to install NVIDIA driver and CuDNN to enable GPU support.

sudo add-apt-repository ppa:graphics-drivers/ppa

sudo apt update

sudo ubuntu-drivers autoinstall

sudo reboot

nvidia-smi

At the time of writing, nvidia-smishows the NVIDIA driver version is 440.64 and CUDA version is 10.2.

We are almost there. The last set of packages must be installed as follows. Some steps might require sudo access.

conda create --name packt

conda activate packt

cd <github-dir>

git clone https://github.com/PacktPublishing/Advanced-Deep-Learning-with-Keras

cd Advanced-Deep-Learning-with-Keras

pip install -r requirements.txt

sudo apt-get install python-pydot

sudo apt-get install ffmpeg

Test if a simple model can be trained without errors:

cd chapter1-keras-quick-tour

python3 mlp-mnist-1.3.2.py

The final output shows the accuracy of the trained model on MNIST test dataset is about 98.2%.

Alternative TensorFlow Installation

If you are having problems with CUDA libraries (ie tf could not load or find libcudart.so.10.X), TensorFlow and CUDA libraries can be installed together using conda:

pip uninstall tensorflow-gpu
conda install -c anaconda tensorflow-gpu

Advanced Deep Learning with TensorFlow 2 and Keras code examples used in the book.

Chapter 1 - Introduction

  1. MLP on MNIST
  2. CNN on MNIST
  3. RNN on MNIST

Chapter 2 - Deep Networks

  1. Functional API on MNIST
  2. Y-Network on MNIST
  3. ResNet v1 and v2 on CIFAR10
  4. DenseNet on CIFAR10

Chapter 3 - AutoEncoders

  1. Denoising AutoEncoders

Sample outputs for random digits:

Random Digits

  1. Colorization AutoEncoder

Sample outputs for random cifar10 images:

Colorized Images

Chapter 4 - Generative Adversarial Network (GAN)

  1. Deep Convolutional GAN (DCGAN)

Radford, Alec, Luke Metz, and Soumith Chintala. "Unsupervised representation learning with deep convolutional generative adversarial networks." arXiv preprint arXiv:1511.06434 (2015).

Sample outputs for random digits:

Random Digits

  1. Conditional (GAN)

Mirza, Mehdi, and Simon Osindero. "Conditional generative adversarial nets." arXiv preprint arXiv:1411.1784 (2014).

Sample outputs for digits 0 to 9:

Zero to Nine

Chapter 5 - Improved GAN

  1. Wasserstein GAN (WGAN)

Arjovsky, Martin, Soumith Chintala, and LΓ©on Bottou. "Wasserstein GAN." arXiv preprint arXiv:1701.07875 (2017).

Sample outputs for random digits:

Random Digits

  1. Least Squares GAN (LSGAN)

Mao, Xudong, et al. "Least squares generative adversarial networks." 2017 IEEE International Conference on Computer Vision (ICCV). IEEE, 2017.

Sample outputs for random digits:

Random Digits

  1. Auxiliary Classifier GAN (ACGAN)

Odena, Augustus, Christopher Olah, and Jonathon Shlens. "Conditional image synthesis with auxiliary classifier GANs. Proceedings of the 34th International Conference on Machine Learning, Sydney, Australia, PMLR 70, 2017."

Sample outputs for digits 0 to 9:

Zero to Nine

Chapter 6 - GAN with Disentangled Latent Representations

  1. Information Maximizing GAN (InfoGAN)

Chen, Xi, et al. "Infogan: Interpretable representation learning by information maximizing generative adversarial nets." Advances in Neural Information Processing Systems. 2016.

Sample outputs for digits 0 to 9:

Zero to Nine

  1. Stacked GAN

Huang, Xun, et al. "Stacked generative adversarial networks." IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Vol. 2. 2017

Sample outputs for digits 0 to 9:

Zero to Nine

Chapter 7 - Cross-Domain GAN

  1. CycleGAN

Zhu, Jun-Yan, et al. "Unpaired Image-to-Image Translation Using Cycle-Consistent Adversarial Networks." 2017 IEEE International Conference on Computer Vision (ICCV). IEEE, 2017.

Sample outputs for random cifar10 images:

Colorized Images

Sample outputs for MNIST to SVHN:

MNIST2SVHN

Chapter 8 - Variational Autoencoders (VAE)

  1. VAE MLP MNIST
  2. VAE CNN MNIST
  3. Conditional VAE and Beta VAE

Kingma, Diederik P., and Max Welling. "Auto-encoding Variational Bayes." arXiv preprint arXiv:1312.6114 (2013).

Sohn, Kihyuk, Honglak Lee, and Xinchen Yan. "Learning structured output representation using deep conditional generative models." Advances in Neural Information Processing Systems. 2015.

I. Higgins, L. Matthey, A. Pal, C. Burgess, X. Glorot, M. Botvinick, S. Mohamed, and A. Lerchner. Ξ²-VAE: Learning basic visual concepts with a constrained variational framework. ICLR, 2017.

Generated MNIST by navigating the latent space:

MNIST

Chapter 9 - Deep Reinforcement Learning

  1. Q-Learning
  2. Q-Learning on Frozen Lake Environment
  3. DQN and DDQN on Cartpole Environment

Mnih, Volodymyr, et al. "Human-level control through deep reinforcement learning." Nature 518.7540 (2015): 529

DQN on Cartpole Environment:

Cartpole

Chapter 10 - Policy Gradient Methods

  1. REINFORCE, REINFORCE with Baseline, Actor-Critic, A2C

Sutton and Barto, Reinforcement Learning: An Introduction

Mnih, Volodymyr, et al. "Asynchronous methods for deep reinforcement learning." International conference on machine learning. 2016.

Policy Gradient on MountainCar Continuous Environment:

Car

Chapter 11 - Object Detection

  1. Single-Shot Detection

Single-Shot Detection on 3 Objects SSD

Chapter 12 - Semantic Segmentation

  1. FCN

  2. PSPNet

Semantic Segmentation

Semantic Segmentation

Chapter 13 - Unsupervised Learning using Mutual Information

  1. Invariant Information Clustering

  2. MINE: Mutual Information Estimation

MINE MINE

Citation

If you find this work useful, please cite:

@book{atienza2020advanced,
  title={Advanced Deep Learning with TensorFlow 2 and Keras: Apply DL, GANs, VAEs, deep RL, unsupervised learning, object detection and segmentation, and more},
  author={Atienza, Rowel},
  year={2020},
  publisher={Packt Publishing Ltd}
}

More Repositories

1

Deep-Reinforcement-Learning-Hands-On

Hands-on Deep Reinforcement Learning, published by Packt
Python
2,750
star
2

The-Kaggle-Book

Code Repository for The Kaggle Book, Published by Packt Publishing
Jupyter Notebook
2,056
star
3

Hands-On-Machine-Learning-for-Algorithmic-Trading

Hands-On Machine Learning for Algorithmic Trading, published by Packt
Jupyter Notebook
1,280
star
4

Node.js-Design-Patterns-Third-Edition

Node.js Design Patterns Third Edition, published by Packt
JavaScript
1,162
star
5

Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original

Machine Learning for Algorithmic Trading, Second Edition - published by Packt
Jupyter Notebook
1,083
star
6

Deep-Learning-with-Keras

Code repository for Deep Learning with Keras published by Packt
Jupyter Notebook
1,047
star
7

Deep-Reinforcement-Learning-Hands-On-Second-Edition

Deep-Reinforcement-Learning-Hands-On-Second-Edition, published by Packt
Jupyter Notebook
1,028
star
8

Learning-JavaScript-Data-Structures-and-Algorithms-Third-Edition

Learning JavaScript Data Structures and Algorithms (Third Edition), published by Packt
JavaScript
1,007
star
9

40-Algorithms-Every-Programmer-Should-Know

40 Algorithms Every Programmer Should Know, published by Packt
Python
910
star
10

Learn-CUDA-Programming

Learn CUDA Programming, published by Packt
Cuda
849
star
11

3D-Graphics-Rendering-Cookbook

3D Graphics Rendering Cookbook, published by Packt.
C++
847
star
12

Vulkan-Cookbook

Code repository for Vulkan Cookbook by Packt
C++
784
star
13

Linux-Kernel-Programming

Linux Kernel Programming, published by Packt
Makefile
759
star
14

Learn-Algorithmic-Trading

Learn Algorithmic Trading, Published by Packt
Python
730
star
15

Django-4-by-example

Django 4 by example (4th Edition) published by Packt
Python
718
star
16

Django-3-by-Example

Django 3 by Example (3rd Edition) published by Packt
Python
710
star
17

Node.js_Design_Patterns_Second_Edition_Code

Code repository for Node.js Design Patterns Second Edition, published by Packt
JavaScript
706
star
18

Python-for-Finance-Cookbook

Python for Finance Cookbook, published by Packt
Jupyter Notebook
665
star
19

Pandas-Cookbook

Pandas Cookbook, published by Packt
Jupyter Notebook
623
star
20

Hands-on-Exploratory-Data-Analysis-with-Python

Hands-on Exploratory Data Analysis with Python, published by Packt
Jupyter Notebook
619
star
21

Java-Coding-Problems

Java Coding Problems, published by Packt
Java
615
star
22

Hands-On-Domain-Driven-Design-with-.NET-Core

Hands-On Domain-Driven Design with .NET Core, published by Packt
C#
602
star
23

Modern-Computer-Vision-with-PyTorch

Modern Computer Vision with PyTorch, published by Packt
Jupyter Notebook
585
star
24

Hands-On-GPU-Accelerated-Computer-Vision-with-OpenCV-and-CUDA

Hands-On GPU Accelerated Computer Vision with OpenCV and CUDA, published by Packt
C++
584
star
25

Django-2-by-Example

Django 2 by Example (2nd Edition) published by Packt
Python
567
star
26

Learning-OpenCV-4-Computer-Vision-with-Python-Third-Edition

Learning OpenCV 4 Computer Vision with Python 3 – Third Edition, published by Packt
Python
562
star
27

Learn-Data-Structures-and-Algorithms-with-Golang

Learn Data Structures and Algorithms with Golang, published by Packt
Go
557
star
28

Causal-Inference-and-Discovery-in-Python

Causal Inference and Discovery in Python by Packt Publishing
Jupyter Notebook
555
star
29

TensorFlow-Machine-Learning-Cookbook

Code repository for TensorFlow Machine Learning Cookbook by Packt
Python
552
star
30

Transformers-for-Natural-Language-Processing

Transformers for Natural Language Processing, published by Packt
Jupyter Notebook
539
star
31

Data-Engineering-with-Python

Data Engineering with Python, published by Packt
Python
537
star
32

Mastering-OpenCV-4-Third-Edition

Mastering OpenCV 4, Third Edition, published by Packt publishing
Assembly
520
star
33

Cpp17-STL-Cookbook

Code files by Packt
C++
514
star
34

Clean-Code-in-Python

Clean Code in Python, published by Packt
Python
513
star
35

Hands-On-Graph-Neural-Networks-Using-Python

Hands-On Graph Neural Networks Using Python, published by Packt
Jupyter Notebook
500
star
36

Getting-Started-with-TensorFlow

Getting Started with TensorFlow, published by Packt
Python
491
star
37

Hands-On-Data-Structures-and-Algorithms-with-Rust

Hands-On Data Structures and Algorithms with Rust, published by Packt
Rust
486
star
38

Linux-Device-Drivers-Development

Linux Device Drivers Development, published by Packt
C
482
star
39

Python-Machine-Learning-Second-Edition

Python Machine Learning - Second Edition, published by Packt
Jupyter Notebook
477
star
40

Mastering-Graphics-Programming-with-Vulkan

C++
469
star
41

Learn-LLVM-12

Learn LLVM 12, published by Packt
C++
465
star
42

Mastering-Embedded-Linux-Programming-Third-Edition

Mastering Embedded Linux Programming Third Edition, published by Packt
C
460
star
43

Python-3-Object-Oriented-Programming-Third-Edition

Python 3 Object-Oriented Programming – Third Edition, published by Packt
Python
453
star
44

Hands-On-Microservices-with-Spring-Boot-and-Spring-Cloud

Hands-On Microservices with Spring Boot and Spring Cloud, published by Packt
Java
452
star
45

Software-Architecture-with-Cpp

Software Architecture with C++, published by Packt
C++
447
star
46

Full-Stack-React-Projects-Second-Edition

Full-Stack React Projects - Second Edition, published by Packt
JavaScript
445
star
47

Python-Feature-Engineering-Cookbook

Python Feature Engineering Cookbook, published by Packt
Jupyter Notebook
442
star
48

Deep-Learning-with-PyTorch

Deep Learning with PyTorch, published by Packt
Jupyter Notebook
437
star
49

Interpretable-Machine-Learning-with-Python

Interpretable Machine Learning with Python, published by Packt
Jupyter Notebook
423
star
50

Python-Machine-Learning-Cookbook

Code files for Python-Machine-Learning-Cookbook
Python
416
star
51

Modern-CMake-for-Cpp

Modern CMake for C++, published by Packt
Dockerfile
411
star
52

Artificial-Intelligence-with-Python

Code repository for Artificial Intelligence with Python, published by Packt
Python
408
star
53

Hands-On-Software-Engineering-with-Golang

Hands-On Software Engineering with Golang, published by Packt
Go
406
star
54

Mastering-Python-for-Finance-Second-Edition

Mastering Python for Finance – Second Edition, published by Packt
Jupyter Notebook
394
star
55

Go-Design-Patterns

This is the code repository for the book, Go Design Patterns, published by Packt
Go
394
star
56

Mastering-Python-Design-Patterns-Second-Edition

Mastering-Python-Design-Patterns-Second-Edition, published by Packt
Python
389
star
57

Mastering-Go-Second-Edition

Mastering Go Second Edition, published by Packt
Go
384
star
58

Hands-On-Machine-Learning-with-CPP

Hands-On Machine Learning with C++, published by Packt
C++
377
star
59

Learn-OpenCV-4-By-Building-Projects-Second-Edition

Learn OpenCV 4 By Building Projects, Second Edition, published by Packt
C++
367
star
60

Hands-On-Computer-Vision-with-TensorFlow-2

Hands-On Computer Vision with TensorFlow 2, published by Packt
Jupyter Notebook
366
star
61

Mastering-OpenCV-4-with-Python

Mastering OpenCV 4 with Python, published by Packt
Python
362
star
62

Hands-On-Microservices-with-Rust

Hands-On Microservices with Rust 2018, published by Packt
Rust
354
star
63

Hands-On-Design-Patterns-with-CPP

Hands-On Design Patterns with C++, published by Packt
C
353
star
64

Python-Machine-Learning-Blueprints

Code repository for Python Machine Learning Blueprints, published by Packt
Jupyter Notebook
349
star
65

Practical-Time-Series-Analysis

Practical Time-Series Analysis, published by Packt
Jupyter Notebook
345
star
66

Machine-Learning-for-Algorithmic-Trading-Bots-with-Python

Jupyter Notebook
337
star
67

Machine-Learning-for-Finance

Machine Learning for Finance, published by Packt
Jupyter Notebook
336
star
68

Effective-Python-Penetration-Testing

Effective Python Penetration Testing by Packt Publishing
Python
334
star
69

Python-Algorithmic-Trading-Cookbook

Python Algorithmic Trading Cookbook, published by Packt
Jupyter Notebook
325
star
70

Hands-On-Intelligent-Agents-with-OpenAI-Gym

Code for Hands On Intelligent Agents with OpenAI Gym book to get started and learn to build deep reinforcement learning agents using PyTorch
Python
322
star
71

Python-Artificial-Intelligence-Projects-for-Beginners

Python Artificial Intelligence Projects for Beginners, published by Packt
Jupyter Notebook
321
star
72

Hands-On-Reactive-Programming-in-Spring-5

Hands-On Reactive Programming in Spring 5, published by Packt
Java
320
star
73

Micro-State-Management-with-React-Hooks

Micro State Management with React Hooks, published by Packt
TypeScript
317
star
74

The-Azure-Cloud-Native-Architecture-Mapbook

The Azure Cloud Native Architecture Mapbook, published by Packt
C#
315
star
75

Godot-Game-Engine-Projects

Godot Game Engine Projects, published by Packt
GDScript
315
star
76

Modern-Time-Series-Forecasting-with-Python

Modern Time Series Forecasting with Python, published by Packt
Jupyter Notebook
315
star
77

Python-GUI-Programming-Cookbook-Second-Edition

Python GUI Programming Cookbook, Second Edition, published by Packt
Python
312
star
78

Computer-Vision-with-OpenCV-3-and-Qt5

Computer Vision with OpenCV 3 and Qt5, published by Packt
C++
305
star
79

Learning-PySpark

Code repository for Learning PySpark by Packt
Jupyter Notebook
303
star
80

Deep-Learning-with-TensorFlow-2-and-Keras

Deep Learning with TensorFlow 2 and Keras, published by Packt
Jupyter Notebook
302
star
81

PyTorch-Computer-Vision-Cookbook

PyTorch Computer Vision Cookbook, Published by Packt
Jupyter Notebook
302
star
82

Mastering-Machine-Learning-for-Penetration-Testing

Mastering Machine Learning for Penetration Testing, published by Packt
Python
298
star
83

Learning-Vuejs-2

This is the code repository for Learning Vue.js 2, published by Packt.
JavaScript
296
star
84

Building-Data-Science-Applications-with-FastAPI

Building Data Science Applications with FastAPI, Published by Packt
Python
295
star
85

OpenGL-4-Shading-Language-Cookbook-Third-Edition

OpenGL 4 Shading Language Cookbook - Third Edition, published by Packt
C
295
star
86

Mastering-Transformers

Mastering Transformers, published by Packt
Jupyter Notebook
289
star
87

Neural-Network-Projects-with-Python

Neural Network Projects with Python, Published by Packt
Python
289
star
88

Bioinformatics-with-Python-Cookbook-Second-Edition

Bioinformatics with Python Cookbook Second Edition, published by Packt
OpenEdge ABL
287
star
89

Hands-on-Python-for-Finance

Hands-on Python for Finance published by Packt.
Jupyter Notebook
284
star
90

Full-Stack-React-TypeScript-and-Node

Full-Stack React, TypeScript, and Node, published by Packt
TypeScript
282
star
91

CPP-Data-Structures-and-Algorithms

C++ Data Structures and Algorithms, published by Packt
C++
279
star
92

The-Modern-Cpp-Challenge

The Modern C++ Challenge, published by Packt
C
276
star
93

The-Complete-Coding-Interview-Guide-in-Java

The Complete Coding Interview Guide in Java, published by Packt
Java
272
star
94

Pandas-Cookbook-Second-Edition

Pandas Cookbook Second Edition, published by Packt
Jupyter Notebook
271
star
95

Full-Stack-React-Projects

Full-Stack React Projects, published by Packt
JavaScript
271
star
96

Machine-Learning-for-Cybersecurity-Cookbook

Machine Learning for Cybersecurity Cookbook, published by Packt
Jupyter Notebook
270
star
97

Natural-Language-Processing-with-TensorFlow

Natural Language Processing with TensorFlow, published by Packt
Jupyter Notebook
269
star
98

50-Projects-In-50-Days---HTML-CSS-JavaScript

50 Projects In 50 Days - HTML, CSS & JavaScript, by Packt Publishing
CSS
269
star
99

Hands-On-Image-Processing-with-Python

Jupyter Notebook
264
star
100

Mastering-Distributed-Tracing

"Mastering Distributed Tracing" by Yuri Shkuro, published by Packt
Java
264
star