Neural Networks with Keras Cookbook
eBook - ePub

Neural Networks with Keras Cookbook

Over 70 recipes leveraging deep learning techniques across image, text, audio, and game bots

V Kishore Ayyadevara

  1. 568 páginas
  2. English
  3. ePUB (apto para móviles)
  4. Disponible en iOS y Android
eBook - ePub

Neural Networks with Keras Cookbook

Over 70 recipes leveraging deep learning techniques across image, text, audio, and game bots

V Kishore Ayyadevara

Detalles del libro
Vista previa del libro
Índice
Citas

Información del libro

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.

Preguntas frecuentes

¿Cómo cancelo mi suscripción?
Simplemente, dirígete a la sección ajustes de la cuenta y haz clic en «Cancelar suscripción». Así de sencillo. Después de cancelar tu suscripción, esta permanecerá activa el tiempo restante que hayas pagado. Obtén más información aquí.
¿Cómo descargo los libros?
Por el momento, todos nuestros libros ePub adaptables a dispositivos móviles se pueden descargar a través de la aplicación. La mayor parte de nuestros PDF también se puede descargar y ya estamos trabajando para que el resto también sea descargable. Obtén más información aquí.
¿En qué se diferencian los planes de precios?
Ambos planes te permiten acceder por completo a la biblioteca y a todas las funciones de Perlego. Las únicas diferencias son el precio y el período de suscripción: con el plan anual ahorrarás en torno a un 30 % en comparación con 12 meses de un plan mensual.
¿Qué es Perlego?
Somos un servicio de suscripción de libros de texto en línea que te permite acceder a toda una biblioteca en línea por menos de lo que cuesta un libro al mes. Con más de un millón de libros sobre más de 1000 categorías, ¡tenemos todo lo que necesitas! Obtén más información aquí.
¿Perlego ofrece la función de texto a voz?
Busca el símbolo de lectura en voz alta en tu próximo libro para ver si puedes escucharlo. La herramienta de lectura en voz alta lee el texto en voz alta por ti, resaltando el texto a medida que se lee. Puedes pausarla, acelerarla y ralentizarla. Obtén más información aquí.
¿Es Neural Networks with Keras Cookbook un PDF/ePUB en línea?
Sí, puedes acceder a Neural Networks with Keras Cookbook de V Kishore Ayyadevara en formato PDF o ePUB, así como a otros libros populares de Computer Science y Neural Networks. Tenemos más de un millón de libros disponibles en nuestro catálogo para que explores.

Información

Año
2019
ISBN
9781789342109
Edición
1
Categoría
Neural Networks

Text Analysis Using Word Vectors

In the previous chapter, we learned about encoding an image or encoding users or movies for recommender systems, where the items that are similar have similar vectors. In this chapter, we will be discussing how to encode text data.
You will be learning about the following topics:
  • Building a word vector from scratch in Python
  • Building a word vector using skip-gram and CBOW models
  • Performing vector arithmetic using pre-trained word vectors
  • Creating a document vector
  • Building word vectors using fastText
  • Building word vectors using GloVe
  • Building sentiment classification using word vectors

Introduction

In the traditional approach of solving text-related problems, we would one-hot encode the word. However, if the dataset has thousands of unique words, the resulting one-hot-encoded vector would have thousands of dimensions, which is likely to result in computation issues. Additionally, similar words will not have similar vectors in this scenario. Word2Vec is an approach that helps us to achieve similar vectors for similar words.
To understand how Word2Vec is useful, let's explore the following problem.
Let's say we have two input sentences:
Intuitively, we know that enjoy and like are similar words. However, in traditional text mining, when we one-hot encode the words, our output looks as follows:
Notice that one-hot encoding results in each word being assigned a column. The major issue with one-hot encoding such as this is that the Eucledian distance between I and enjoy is the same as the Eucledian distance between enjoy and like.
However, intuitively, we know that the distance between enjoy and like should be lower than the distance between I and enjoy, as enjoy and like are similar to each other.

Building a word vector from scratch in Python

The principle based on which we'll build a word vector is related words will have similar words surrounding them.
For example: the words queen and princess will have similar words (related to a kingdom) around them more frequently. In a way, the context (surrounding words) of these words would be similar.

Getting ready

Our dataset (of two sentences) looks as follows when we take the surrounding words as input and the remaining (middle) word as output:
Notice that we are using the middle word as output and the remaining words as input. A vectorized form of this input and output looks as follows (recall the way in which we converted a sentence into a vector in the Need for encoding in text analysis section in Chapter 9, Encoding Input):
Notice that the vectorized form of input in the first row is {0, 1, 1, 1, 0}, as the input word index is {1, 2, 3}, and the output is {1, 0, 0, 0, 0} as the output word's index is {1}.
In such a scenario, our hidden layer has three neurons associated with it. Our neural network would look as follows:
The dimensions of each layer are as follows:
Layer
Shape of weights
Commentary
Input layer
1 x 5
Each row is multiplied by five weights.
Hidden layer
5 x 3
There are five input weights each to the three neurons in the hidden layer.
Output of hidden layer
1 x 3
This is the matrix multiplication of the input and the hidden layer.
Weights from hidden to output
3 x 5
Three output hidden units are mapped to five output columns (as there are five unique words).
Output layer
1 x 5
This is the matrix multiplication between the output of the hidden layer and the weights from the hidden to the output layer.
Note that we would not be applying activation on top of the hidden layer while building a word vector.
The output layer's values are not restricted to a specific range. Hence, we pass them through the softmax function so that we arrive at the probability of words. Furthermore, we minimize the cross-entropy loss to arrive at the optimal...

Índice

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Contributors
  6. Preface
  7. Building a Feedforward Neural Network
  8. Building a Deep Feedforward Neural Network
  9. Applications of Deep Feedforward Neural Networks
  10. Building a Deep Convolutional Neural Network
  11. Transfer Learning
  12. Detecting and Localizing Objects in Images
  13. Image Analysis Applications in Self-Driving Cars
  14. Image Generation
  15. Encoding Inputs
  16. Text Analysis Using Word Vectors
  17. Building a Recurrent Neural Network
  18. Applications of a Many-to-One Architecture RNN
  19. Sequence-to-Sequence Learning
  20. End-to-End Learning
  21. Audio Analysis
  22. Reinforcement Learning
  23. Other Books You May Enjoy
Estilos de citas para Neural Networks with Keras Cookbook

APA 6 Citation

Ayyadevara, K. (2019). Neural Networks with Keras Cookbook (1st ed.). Packt Publishing. Retrieved from https://www.perlego.com/book/921351/neural-networks-with-keras-cookbook-over-70-recipes-leveraging-deep-learning-techniques-across-image-text-audio-and-game-bots-pdf (Original work published 2019)

Chicago Citation

Ayyadevara, Kishore. (2019) 2019. Neural Networks with Keras Cookbook. 1st ed. Packt Publishing. https://www.perlego.com/book/921351/neural-networks-with-keras-cookbook-over-70-recipes-leveraging-deep-learning-techniques-across-image-text-audio-and-game-bots-pdf.

Harvard Citation

Ayyadevara, K. (2019) Neural Networks with Keras Cookbook. 1st edn. Packt Publishing. Available at: https://www.perlego.com/book/921351/neural-networks-with-keras-cookbook-over-70-recipes-leveraging-deep-learning-techniques-across-image-text-audio-and-game-bots-pdf (Accessed: 14 October 2022).

MLA 7 Citation

Ayyadevara, Kishore. Neural Networks with Keras Cookbook. 1st ed. Packt Publishing, 2019. Web. 14 Oct. 2022.