Deep Learning with Theano

Develop deep neural networks in Theano with practical code examples for image classification, machine translation, reinforcement agents, or generative models.

Deep Learning with Theano

This ebook is included in a Mapt subscription
Christopher Bourez

Develop deep neural networks in Theano with practical code examples for image classification, machine translation, reinforcement agents, or generative models.
$0.00
$30.60
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786465825
Paperback300 pages

Book Description

This book offers a complete overview of Deep Learning with Theano, a Python-based library that makes optimizing numerical expressions and deep learning models easy on CPU or GPU.

The book provides some practical code examples that help the beginner understand how easy it is to build complex neural networks, while more experimented data scientists will appreciate the reach of the book, addressing supervised and unsupervised learning, generative models, reinforcement learning in the fields of image recognition, natural language processing, or game strategy.

The book also discusses image recognition tasks that range from simple digit recognition, image classification, object localization, image segmentation, to image captioning. Natural language processing examples include text generation, chatbots, machine translation, and question answering. The last example deals with generating random data that looks real and solving games such as in the Open-AI gym.

At the end, this book sums up the best -performing nets for each task. While early research results were based on deep stacks of neural layers, in particular, convolutional layers, the book presents the principles that improved the efficiency of these architectures, in order to help the reader build new custom nets.

Table of Contents

Chapter 1: Theano Basics
The need for tensors
Installing and loading Theano
Tensors
Graphs and symbolic computing
Operations on tensors
Memory and variables
Functions and automatic differentiation
Loops in symbolic computing
Configuration, profiling and debugging
Summary
Chapter 2: Classifying Handwritten Digits with a Feedforward Network
The MNIST dataset
Structure of a training program
Classification loss function
Single-layer linear model
Cost function and errors
Backpropagation and stochastic gradient descent
Multiple layer model
Convolutions and max layers
Training
Dropout
Inference
Optimization and other update rules
Related articles
Summary
Chapter 3: Encoding Word into Vector
Encoding and embedding
Dataset
Continuous Bag of Words model
Training the model
Visualizing the learned embeddings
Evaluating embeddings – analogical reasoning
Evaluating embeddings – quantitative analysis
Application of word embeddings
Weight tying
Further reading
Summary
Chapter 4: Generating Text with a Recurrent Neural Net
Need for RNN
A dataset for natural language
Simple recurrent network
Metrics for natural language performance
Training loss comparison
Example of predictions
Applications of RNN
Related articles
Summary
Chapter 5: Analyzing Sentiment with a Bidirectional LSTM
Installing and configuring Keras
Preprocessing text data
Designing the architecture for the model
Compiling and training the model
Evaluating the model
Saving and loading the model
Running the example
Further reading
Summary
Chapter 6: Locating with Spatial Transformer Networks
MNIST CNN model with Lasagne
A localization network
Unsupervised learning with co-localization
Region-based localization networks
Further reading
Summary
Chapter 7: Classifying Images with Residual Networks
Natural image datasets
Residual connections
Stochastic depth
Dense connections
Multi-GPU
Data augmentation
Further reading
Summary
Chapter 8: Translating and Explaining with Encoding – decoding Networks
Sequence-to-sequence networks for natural language processing
Seq2seq for translation
Seq2seq for chatbots
Improving efficiency of sequence-to-sequence network
Deconvolutions for images
Multimodal deep learning
Further reading
Summary
Chapter 9: Selecting Relevant Inputs or Memories with the Mechanism of Attention
Differentiable mechanism of attention
Store and retrieve information in Neural Turing Machines
Memory networks
Further reading
Summary
Chapter 10: Predicting Times Sequences with Advanced RNN
Dropout for RNN
Deep approaches for RNN
Stacked recurrent networks
Deep transition recurrent network
Highway networks design principle
Recurrent Highway Networks
Further reading
Summary
Chapter 11: Learning from the Environment with Reinforcement
Reinforcement learning tasks
Simulation environments
Q-learning
Deep Q-network
Training stability
Policy gradients with REINFORCE algorithms
Related articles
Summary
Chapter 12: Learning Features with Unsupervised Generative Networks
Generative models
Semi-supervised learning
Further reading
Summary
Chapter 13: Extending Deep Learning with Theano
Theano Op in Python for CPU
Theano Op in Python for the GPU
Theano Op in C for CPU
Theano Op in C for GPU
Coalesced transpose via shared memory, NVIDIA parallel for all
The future of artificial intelligence
Further reading
Summary

What You Will Learn

  • Get familiar with Theano and deep learning
  • Provide examples in supervised, unsupervised, generative, or reinforcement learning.
  • Discover the main principles for designing efficient deep learning nets: convolutions, residual connections, and recurrent connections.
  • Use Theano on real-world computer vision datasets, such as for digit classification and image classification.
  • Extend the use of Theano to natural language processing tasks, for chatbots or machine translation
  • Cover artificial intelligence-driven strategies to enable a robot to solve games or learn from an environment
  • Generate synthetic data that looks real with generative modeling
  • Become familiar with Lasagne and Keras, two frameworks built on top of Theano

Authors

Table of Contents

Chapter 1: Theano Basics
The need for tensors
Installing and loading Theano
Tensors
Graphs and symbolic computing
Operations on tensors
Memory and variables
Functions and automatic differentiation
Loops in symbolic computing
Configuration, profiling and debugging
Summary
Chapter 2: Classifying Handwritten Digits with a Feedforward Network
The MNIST dataset
Structure of a training program
Classification loss function
Single-layer linear model
Cost function and errors
Backpropagation and stochastic gradient descent
Multiple layer model
Convolutions and max layers
Training
Dropout
Inference
Optimization and other update rules
Related articles
Summary
Chapter 3: Encoding Word into Vector
Encoding and embedding
Dataset
Continuous Bag of Words model
Training the model
Visualizing the learned embeddings
Evaluating embeddings – analogical reasoning
Evaluating embeddings – quantitative analysis
Application of word embeddings
Weight tying
Further reading
Summary
Chapter 4: Generating Text with a Recurrent Neural Net
Need for RNN
A dataset for natural language
Simple recurrent network
Metrics for natural language performance
Training loss comparison
Example of predictions
Applications of RNN
Related articles
Summary
Chapter 5: Analyzing Sentiment with a Bidirectional LSTM
Installing and configuring Keras
Preprocessing text data
Designing the architecture for the model
Compiling and training the model
Evaluating the model
Saving and loading the model
Running the example
Further reading
Summary
Chapter 6: Locating with Spatial Transformer Networks
MNIST CNN model with Lasagne
A localization network
Unsupervised learning with co-localization
Region-based localization networks
Further reading
Summary
Chapter 7: Classifying Images with Residual Networks
Natural image datasets
Residual connections
Stochastic depth
Dense connections
Multi-GPU
Data augmentation
Further reading
Summary
Chapter 8: Translating and Explaining with Encoding – decoding Networks
Sequence-to-sequence networks for natural language processing
Seq2seq for translation
Seq2seq for chatbots
Improving efficiency of sequence-to-sequence network
Deconvolutions for images
Multimodal deep learning
Further reading
Summary
Chapter 9: Selecting Relevant Inputs or Memories with the Mechanism of Attention
Differentiable mechanism of attention
Store and retrieve information in Neural Turing Machines
Memory networks
Further reading
Summary
Chapter 10: Predicting Times Sequences with Advanced RNN
Dropout for RNN
Deep approaches for RNN
Stacked recurrent networks
Deep transition recurrent network
Highway networks design principle
Recurrent Highway Networks
Further reading
Summary
Chapter 11: Learning from the Environment with Reinforcement
Reinforcement learning tasks
Simulation environments
Q-learning
Deep Q-network
Training stability
Policy gradients with REINFORCE algorithms
Related articles
Summary
Chapter 12: Learning Features with Unsupervised Generative Networks
Generative models
Semi-supervised learning
Further reading
Summary
Chapter 13: Extending Deep Learning with Theano
Theano Op in Python for CPU
Theano Op in Python for the GPU
Theano Op in C for CPU
Theano Op in C for GPU
Coalesced transpose via shared memory, NVIDIA parallel for all
The future of artificial intelligence
Further reading
Summary

Book Details

ISBN 139781786465825
Paperback300 pages
Read More

Read More Reviews