0%

Book Description

Implement neural network architectures by building them from scratch for multiple real-world applications.

Key Features

  • From scratch, build multiple neural network architectures such as CNN, RNN, LSTM in Keras
  • Discover tips and tricks for designing a robust neural network to solve real-world problems
  • Graduate from understanding the working details of neural networks and master the art of fine-tuning them

Book Description

This book will take you from the basics of neural networks to advanced implementations of architectures using a recipe-based approach.

We will learn about how neural networks work and the impact of various hyper parameters on a network's accuracy along with leveraging neural networks for structured and unstructured data.

Later, we will learn how to classify and detect objects in images. We will also learn to use transfer learning for multiple applications, including a self-driving car using Convolutional Neural Networks.

We will generate images while leveraging GANs and also by performing image encoding. Additionally, we will perform text analysis using word vector based techniques. Later, we will use Recurrent Neural Networks and LSTM to implement chatbot and Machine Translation systems.

Finally, you will learn about transcribing images, audio, and generating captions and also use Deep Q-learning to build an agent that plays Space Invaders game.

By the end of this book, you will have developed the skills to choose and customize multiple neural network architectures for various deep learning problems you might encounter.

What you will learn

  • Build multiple advanced neural network architectures from scratch
  • Explore transfer learning to perform object detection and classification
  • Build self-driving car applications using instance and semantic segmentation
  • Understand data encoding for image, text and recommender systems
  • Implement text analysis using sequence-to-sequence learning
  • Leverage a combination of CNN and RNN to perform end-to-end learning
  • Build agents to play games using deep Q-learning

Who this book is for

This intermediate-level book targets beginners and intermediate-level machine learning practitioners and data scientists who have just started their journey with neural networks. This book is for those who are looking for resources to help them navigate through the various neural network architectures; you'll build multiple architectures, with concomitant case studies ordered by the complexity of the problem. A basic understanding of Python programming and a familiarity with basic machine learning are all you need to get started with this book.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Neural Networks with Keras Cookbook
  3. Dedication
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the author
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    5. Get in touch
      1. Reviews
  7. Building a Feedforward Neural Network
    1. Introduction
    2. Architecture of a simple neural network
      1. Training a neural network
    3. Applications of a neural network
    4. Feed-forward propagation from scratch in Python
      1. Getting ready
      2. How to do it...
    5. Building back-propagation from scratch in Python
      1. Getting ready
      2. How to do it...
      3. There's more...
    6. Building a neural network in Keras
      1. How to do it...
        1. Installing Keras
        2. Building our first model in Keras
  8. Building a Deep Feedforward Neural Network
    1. Training a vanilla neural network
      1. Getting ready
      2. How to do it...
      3. How it works...
    2. Scaling the input dataset
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Impact on training when the majority of inputs are greater than zero
      1. Getting ready
      2. How to do it...
    4. Impact of batch size on model accuracy
      1. Getting ready
      2. How to do it...
      3. How it works...
    5. Building a deep neural network to improve network accuracy
      1. Getting ready
      2. How to do it...
    6. Varying the learning rate to improve network accuracy
      1. Getting ready
      2. How to do it...
    7. Varying the loss optimizer to improve network accuracy
      1. Getting ready
      2. There's more...
    8. Understanding the scenario of overfitting
      1. Overcoming over-fitting using regularization
      2. How to do it
      3. Overcoming overfitting using dropout
    9. Speeding up the training process using batch normalization
      1. How to do it...
  9. Applications of Deep Feedforward Neural Networks
    1. Introduction
    2. Predicting credit default
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Assigning weights for classes
      1. Getting ready
      2. How to do it...
    4. Predicting house prices
      1. Getting ready
      2. How to do it...
      3. Defining the custom loss function
    5. Categorizing news articles into topics
      1. Getting ready
      2. How to do it...
    6. Classifying common audio
      1. How to do it...
    7. Stock price prediction
      1. Getting ready
      2. How to do it...
    8. Leveraging a functional API
      1. How to do it...
    9. Defining weights for rows
      1. How to do it...
  10. Building a Deep Convolutional Neural Network
    1. Introduction
    2. Inaccuracy of traditional neural networks when images are translated
      1. How to do it...
        1. Problems with traditional NN
    3. Building a CNN from scratch using Python
      1. Getting ready
        1. Understanding convolution
          1. Filter
          2. Strides
          3. Padding
        2. From convolution to activation
        3. From convolution activation to pooling
        4. How do convolution and pooling help?
      2. How to do it...
        1. Validating the CNN output
    4. CNNs to improve accuracy in the case of image translation
      1. Getting ready
      2. How to do it...
    5. Gender classification using CNNs
      1. Getting ready
      2. How to do it...
      3. There's more...
    6. Data augmentation to improve network accuracy
      1. Getting ready
      2. How to do it...
        1. Model accuracy without data augmentation
        2. Model accuracy with data augmentation
  11. Transfer Learning
    1. Gender classification of the person in an image using CNNs
      1. Getting ready
      2. How to do it...
        1. Scenario 1 – big images
        2. Scenario 2 – smaller images
        3. Scenario 3 – aggressive pooling on big images
    2. Gender classification of the person in image using the VGG16 architecture-based model
      1. Getting ready
      2. How to do it...
    3. Visualizing the output of the intermediate layers of a neural network
      1. Getting ready
      2. How to do it...
    4. Gender classification of the person in image using the VGG19 architecture-based model
      1. Getting ready
      2. How to do it...
    5. Gender classification using the Inception v3 architecture-based model
      1. How to do it...
    6. Gender classification of the person in image using the ResNet 50 architecture-based model
      1. How to do it...
    7. Detecting the key points within image of a face
      1. Getting ready
      2. How to do it...
  12. Detecting and Localizing Objects in Images
    1. Introduction
    2. Creating the dataset for a bounding box
      1. How to do it...
        1. Windows
        2. Ubuntu
        3. MacOS
    3. Generating region proposals within an image, using selective search
      1. Getting ready
      2. How to do it...
    4. Calculating an intersection over a union between two images
      1. How to do it...
    5. Detecting objects, using region proposal-based CNN
      1. Getting ready
      2. How to do it...
    6. Performing non-max suppression
      1. Getting ready
      2. How to do it...
    7. Detecting a person using an anchor box-based algorithm
      1. Getting ready
      2. How to do it...
      3. There's more...
  13. Image Analysis Applications in Self-Driving Cars
    1. Traffic sign identification
      1. Getting ready
      2. How to do it...
    2. Predicting the angle within which a car needs to be turned
      1. Getting ready
      2. How to do it...
    3. Instance segmentation using the U-net architecture
      1. Getting ready
      2. How to do it...
    4. Semantic segmentation of objects in an image
      1. Getting ready
      2. How to do it...
  14. Image Generation
    1. Introduction
    2. Generating images that can fool a neural network using adversarial attack
      1. Getting ready
      2. How to do it...
    3. DeepDream algorithm to generate images
      1. Getting ready
      2. How to do it...
    4. Neural style transfer between images
      1. Getting ready
      2. How to do it...
    5. Generating images of digits using Generative Adversarial Networks
      1. Getting ready
      2. How to do it...
      3. There's more...
    6. Generating images using a Deep Convolutional GAN
      1. How to do it...
    7. Face generation using a Deep Convolutional GAN
      1. Getting ready
      2. How to do it...
    8. Face transition from one to another
      1. Getting ready
      2. How to do it...
    9. Performing vector arithmetic on generated images
      1. Getting ready
      2. How to do it...
      3. There's more...
  15. Encoding Inputs
    1. Introduction
    2. Need for encoding
      1. Need for encoding in text analysis
      2. Need for encoding in image analysis
      3. Need for encoding in recommender systems
    3. Encoding an image
      1. Getting ready
      2. How to do it...
        1. Vanilla autoencoder
        2. Multilayer autoencoder
        3. Convolutional autoencoder
        4. Grouping similar images
    4. Encoding for recommender systems
      1. Getting ready
      2. How to do it...
  16. Text Analysis Using Word Vectors
    1. Introduction
    2. Building a word vector from scratch in Python
      1. Getting ready
      2. How to do it...
        1. Measuring the similarity between word vectors
    3. Building a word vector using the skip-gram and CBOW models
      1. Getting ready
      2. How to do it
    4. Performing vector arithmetic using pre-trained word vectors
      1. How to do it...
    5. Creating a document vector
      1. Getting ready
      2. How to do it...
    6. Building word vectors using fastText
      1. Getting ready
      2. How to do it...
    7. Building word vectors using GloVe
      1. Getting ready
      2. How to do it...
    8. Building sentiment classification using word vectors
      1. How to do it...
      2. There's more...
  17. Building a Recurrent Neural Network
    1. Introduction
      1. Intuition of RNN architecture
      2. Interpreting an RNN
      3. Why store memory?
    2. Building an RNN from scratch in Python
      1. Getting ready
      2. How to do it...
        1. Validating the output
    3. Implementing RNN for sentiment classification
      1. How to do it...
      2. There's more...
    4. Building a LSTM Network from scratch in Python
      1. Getting ready
      2. How to do it...
        1. Validating the output
    5. Implementing LSTM for sentiment classification
      1. How to do it...
    6. Implementing stacked LSTM for sentiment classification
      1. How to do it...
      2. There's more...
  18. Applications of a Many-to-One Architecture RNN
    1. Generating text
      1. Getting ready
      2. How to do it...
    2. Movie recommendations
      1. Getting ready
      2. How to do it...
        1. Taking user history into consideration
    3. Topic-modeling, using embeddings
      1. Getting ready
      2. How to do it...
      3. There's more...
    4. Forecasting the value of a stock's price
      1. Getting ready
      2. How to do it...
        1. The last five days' stock prices only
        2. The pitfalls
        3. Assigning different weights to different time periods
        4. The last five days' stock prices plus news data
      3. There's more...
  19. Sequence-to-Sequence Learning
    1. Introduction
    2. Returning sequences of outputs from a network
    3. Building a chatbot
      1. Getting ready
      2. How to do it...
        1. Intent extraction
        2. Putting it all together
    4. Machine translation
      1. Getting ready
      2. How to do it...
        1. Preprocessing the data
        2. Traditional many to many architecture
        3. Many to hidden to many architecture
    5. Encoder decoder architecture for machine translation
      1. Getting ready
      2. How to do it...
    6. Encoder decoder architecture with attention for machine translation
      1. How to do it...
  20. End-to-End Learning
    1. Introduction
    2. Connectionist temporal classification (CTC)
      1. Decoding CTC
      2. Calculating the CTC loss value
    3. Handwritten-text recognition
      1. Getting ready
      2. How to do it...
    4. Image caption generation
      1. Getting ready
      2. How to do it...
    5. Generating captions, using beam search
      1. Getting ready
      2. How to do it...
  21. Audio Analysis
    1. Classifying a song by genre
      1. Getting ready
      2. How to do it...
    2. Generating music using deep learning
      1. Getting ready
      2. How to do it...
    3. Transcribing audio into text
      1. Getting ready
      2. How to do it...
      3. There's more...
  22. Reinforcement Learning
    1. The optimal action to take in a simulated game with a non-negative reward
      1. Getting ready
      2. How to do it...
    2. The optimal action to take in a state in a simulated game 
      1. Getting ready
      2. How to do it...
      3. There's more...
    3. Q-learning to maximize rewards when playing Frozen Lake
      1. Getting ready
      2. How to do it...
    4. Deep Q-learning to balance a cart pole
      1. Getting ready
      2. How to do it...
    5. Deep Q-learning to play Space Invaders game
      1. Getting ready
      2. How to do it...
  23. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think