Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 10

Chapter 8 :

Generative deep learning


Contents

8.1 Text generation with LSTM


8.1.1: A brief history of generative recurrent networks
8.1.2: How to generate sequence data?
8.1.3: The importance of the sampling strategy

8.1.4: Implementing character-level LSTM text generation

8.2 Implementing DeepDream

8.3 Performing neural style transfer

8.4 Variational autoencoders

8.5 Understanding generative adversarial networks


3.1.2 Models : networks of layers

• A deep-learning model is a directed, acyclic graph of layers.


output
• Some common network topologies
output

a) Two- branch networks


b) Multi-head networks
(a) (b)
c) Inception blocks

Network in network !
(c) GoogleNet
• Topology of a network defines a hypothesis space.

• By choosing a network topology, you constrain your space of possibilities


(hypothesis space)
3.1.3 Loss function and optimizers : key to configuring the learning process

• Loss function
- Criteria for judging the similarity between input and model prediction
- It represents a measure of success for the task at hand Your own objective functions
- Loss functions for common problems for new research problems

Loss function Problem

* Mean-Squared Error (MSE)  Regression problem

* Binary Cross-entropy  Binary classification problem

* Categorical Cross-entropy  Multi-class classification task

• Optimizer
- Determines how the network will be updated based on the loss function. (SGD, Momentum , Adam,….)
3.2 Introduction to Keras

• Deep-learning framework for Python


• Compatible with any version of Python from 2.7 to 3.6

• Keras has the following key features

- Allow same code to run on CPU and GPU


- User-friendly API
- Built-in support (CNN, RNN)
- Arbitrary network architectures
(Multi-input and multi-output, Layer sharing)
Layer sharing
3.2.1 Keras, Tensorflow, Theano, and CNTK

• Keras is model level library, providing high-level building blocks(layers)

• Keras doesn’t handle low-level operation (tensor manipulation and differentiation) Recommended

• For low-level operation, backend engine is required

• Recommend using the TensorFlow backend as the default

Backend engine 
Library for hardware 
Hardware 
3.2.2 Developing with Keras : a quick overview

• The typical Keras workflow (MNIST)

1. Define your training data: input tensors and target tensors.

2. Define a network of layers (or model) that maps your inputs to your targets.

* Two ways to define a model

(1) Sequential API (most common)


(2) Functional API Sequential class

Once model architecture is defined,


all of the following steps are the same.
Functional API
3.2.2 Developing with Keras : a quick overview

3. Configure the learning process by choosing a loss function, an optimizer, and some metrics to monitor.

4. Iterate on your training data by calling the fit() method of your model.
3.2.2 Developing with Keras : a quick overview

The typical Keras workflow


Thank you for listening

You might also like