Reader small image

You're reading from  The Deep Learning with Keras Workshop

Product typeBook
Published inJul 2020
Reading LevelIntermediate
PublisherPackt
ISBN-139781800562967
Edition1st Edition
Languages
Tools
Right arrow
Authors (3):
Matthew Moocarme
Matthew Moocarme
author image
Matthew Moocarme

Matthew Moocarme is an accomplished data scientist with more than eight years of experience in creating and utilizing machine learning models. He comes from a background in the physical sciences, in which he holds a Ph.D. in physics from the Graduate Center of CUNY. Currently, he leads a team of data scientists and engineers in the media and advertising space to build and integrate machine learning models for a variety of applications. In his spare time, Matthew enjoys sharing his knowledge with the data science community through published works, conference presentations, and workshops.
Read more about Matthew Moocarme

Mahla Abdolahnejad
Mahla Abdolahnejad
author image
Mahla Abdolahnejad

Mahla Abdolahnejad is a Ph.D. candidate in systems and computer engineering with Carleton University, Canada. She also holds a bachelor's degree and a master's degree in biomedical engineering, which first exposed her to the field of artificial intelligence and artificial neural networks, in particular. Her Ph.D. research is focused on deep unsupervised learning for computer vision applications. She is particularly interested in exploring the differences between a human's way of learning from the visual world and a machine's way of learning from the visual world, and how to push machine learning algorithms toward learning and thinking like humans.
Read more about Mahla Abdolahnejad

Ritesh Bhagwat
Ritesh Bhagwat
author image
Ritesh Bhagwat

Ritesh Bhagwat has a master's degree in applied mathematics with a specialization in computer science. He has over 14 years of experience in data-driven technologies and has led and been a part of complex projects ranging from data warehousing and business intelligence to machine learning and artificial intelligence. He has worked with top-tier global consulting firms as well as large multinational financial institutions. Currently, he works as a data scientist. Besides work, he enjoys playing and watching cricket and loves to travel. He is also deeply interested in Bayesian statistics.
Read more about Ritesh Bhagwat

View More author details
Right arrow

Keras

Keras is designed to be a high-level neural network API that is built on top of frameworks such as TensorFlow, CNTK, and Theano. One of the great benefits of using Keras as an introduction to deep learning for beginners is that it is very user-friendly; advanced functions such as optimizers and layers are already built into the library and do not have to be written from scratch. This is why Keras is popular not only among beginners but also seasoned experts. Also, the library allows the rapid prototyping of neural networks, supports a wide variety of network architectures, and can be run on both CPUs and GPUs.

Note

You can find the library and all the documentation for Keras here: https://Keras.io/.

Keras is used to create and train neural networks and does not offer much in terms of other machine learning algorithms, including supervised algorithms such as support vector machines and unsupervised algorithms such as k-means clustering. What Keras does offer, though, is a well-designed API that can be used to create and train neural networks, which takes away much of the effort that's required to apply linear algebra and multivariate calculus accurately.

The specific modules that are available from the Keras library, such as neural layers, cost functions, optimizers, initialization schemes, activation functions, and regularization schemes, will be explained thoroughly throughout this book. All these modules have relevant functions that can be used to optimize performance for training neural networks for specific tasks.

Advantages of Keras

Here are a few of the main advantages of using Keras for machine learning purposes:

  • User-friendly: Much like scikit-learn, Keras features an easy-to-use API that allows users to focus on model-building rather than the specifics of the algorithms.
  • Modular: The API consists of fully configurable modules that can all be plugged together and work seamlessly.
  • Extensible: It is relatively simple to add new modules to the library. This allows users to take advantage of the many robust modules within the library while providing them the flexibility to create their own.
  • Open source: Keras is an open source library and is constantly improving and adding modules to its code base thanks to the work of many collaborators working in conjunction to build improvements and help create a robust library for all.
  • Works with Python: Keras models are declared directly in Python rather than in separate configuration files, which allows Keras to take advantage of working with Python, such as ease of debugging and extensibility.

Disadvantages of Keras

Here are a few of the main disadvantages of using Keras for machine learning purposes:

  • Advanced customization: While simple surface-level customization such as creating simple custom loss functions or neural layers is facile, it can be difficult to change how the underlying architecture works.
  • Lack of examples: Beginners often rely on examples to kick-start their learning. Advanced examples can be lacking in the Keras documentation, which can prevent beginners from advancing in their learning.

Keras offers those familiar with the Python programming language and machine learning the ability to create neural network architectures easily. Since neural networks are quite complicated, we will use scikit-learn to introduce many machine learning concepts before applying them to the Keras library.

More Than Building Models

While machine learning libraries such as scikit-learn and Keras were created to help build and train predictive models, their practicality extends much further. One common use case of building models is that they can be utilized to perform predictions on new data. Once a model has been trained, new observations can be fed into the model to generate predictions. Models may even be used as intermediate steps. For example, neural network models can be used as feature extractors, classifying objects in an image that can then be fed into a subsequent model, as illustrated in the following image:

Figure 1.24: Classifying objects using deep learning

Figure 1.24: Classifying objects using deep learning

Another common use case for models is that they can be used to summarize datasets by learning representations of the data. Such models are known as auto-encoders, a type of neural network architecture that can be used to learn such representations of a given dataset. Therefore, the dataset can thus be represented in a reduced dimension with minimal loss of information:

Figure 1.25: An example of using deep learning for text summarization

Figure 1.25: An example of using deep learning for text summarization

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
The Deep Learning with Keras Workshop
Published in: Jul 2020Publisher: PacktISBN-13: 9781800562967

Authors (3)

author image
Matthew Moocarme

Matthew Moocarme is an accomplished data scientist with more than eight years of experience in creating and utilizing machine learning models. He comes from a background in the physical sciences, in which he holds a Ph.D. in physics from the Graduate Center of CUNY. Currently, he leads a team of data scientists and engineers in the media and advertising space to build and integrate machine learning models for a variety of applications. In his spare time, Matthew enjoys sharing his knowledge with the data science community through published works, conference presentations, and workshops.
Read more about Matthew Moocarme

author image
Mahla Abdolahnejad

Mahla Abdolahnejad is a Ph.D. candidate in systems and computer engineering with Carleton University, Canada. She also holds a bachelor's degree and a master's degree in biomedical engineering, which first exposed her to the field of artificial intelligence and artificial neural networks, in particular. Her Ph.D. research is focused on deep unsupervised learning for computer vision applications. She is particularly interested in exploring the differences between a human's way of learning from the visual world and a machine's way of learning from the visual world, and how to push machine learning algorithms toward learning and thinking like humans.
Read more about Mahla Abdolahnejad

author image
Ritesh Bhagwat

Ritesh Bhagwat has a master's degree in applied mathematics with a specialization in computer science. He has over 14 years of experience in data-driven technologies and has led and been a part of complex projects ranging from data warehousing and business intelligence to machine learning and artificial intelligence. He has worked with top-tier global consulting firms as well as large multinational financial institutions. Currently, he works as a data scientist. Besides work, he enjoys playing and watching cricket and loves to travel. He is also deeply interested in Bayesian statistics.
Read more about Ritesh Bhagwat