GLOBAL RESEARCH SYNDICATE
No Result
View All Result
  • Login
  • Latest News
  • Consumer Research
  • Survey Research
  • Marketing Research
  • Industry Research
  • Data Collection
  • More
    • Data Analysis
    • Market Insights
  • Latest News
  • Consumer Research
  • Survey Research
  • Marketing Research
  • Industry Research
  • Data Collection
  • More
    • Data Analysis
    • Market Insights
No Result
View All Result
globalresearchsyndicate
No Result
View All Result
Home Data Analysis

Deep Learning with Keras Tutorial – Part 1

globalresearchsyndicate by globalresearchsyndicate
November 25, 2019
in Data Analysis
0
Deep Learning with Keras Tutorial – Part 1
0
SHARES
33
VIEWS
Share on FacebookShare on Twitter


About this series

This post is the first part of Deep Learning with Keras series.
This series aims to introduce the Keras deep learning library and how to use it
to train various deep learning models. We will cover topics such as regression,
classification, convolution, recurrent networks, transfer learning and many
others. The tutorials will be completely example driven to make sure the readers
learn the concepts and how to apply them on real datasets.

In the first post, we will introduce Keras and its different
components. We will know the most important features and the steps needed to
define deep learning models.

-Advertisement-Online data science courses to jumpstart your future.

What is Keras?

Keras is a deep-learning framework that provides a
convenient way to define and train almost any kind of deep-learning model. It is
written in Python and can be run on top of TensorFlow, CNTK, or Theano. You are
free to use it in commercial projects since it is distributed under the MIT
license.

What makes Keras so popular?

One of the most important characteristics of Keras is its user-friendly
API. You could develop a state of art deep learning model in no time. Therefore,
it is ideal for easy and fast prototyping. In addition, it supports many modern
deep learning layers such as convolutional and recurrent layers. Keras layers
can be added sequentially or in many different combinations in a very easy way.
Regarding hardware, you can run Keras on CPUs and GPUs and switch between them
in a very easy way.

Installing Keras

The installation process is very easy. First, we need to
install the backend where all the calculations take place (We will choose TensorFlow).
Then we install Keras.

In your command line type:

$ pip install tensorflow
$ pip install keras

It is as simple as this. Let us test the implementation:

$ python -c 'import keras; print(keras.__version__)'

You should now see the installed version of Keras.

Keras Workflow

Keras Workflow

In order to build a deep learning project in Keras you
normally would follow the following workflow:

  1. Define your training data
  2. Define your network
  3. Configure the learning process
    by choosing:

    1. Loss function
    1. Optimizer
    1. Metrics
  4. Iterate over the training data
    and start fitting your model

Keras Models

The core data structure of Keras is the Model class. It is found under keras.models that gives you two ways to define models: The Sequential class and the Model class. The Sequential class builds the network layer by layer in a sequential order. The Model class allows for more complex network structures which we will see in future posts.

Model Lifecycle

A Keras model follows the following lifecycle:

  1. Model creation
    1. Define a model using the Sequential or Model class
    1. Add the layers
  2. Configure the model by specifying the loss, optimizer and metrics. This is done by calling the compile method.
  3. Train the model by calling the fit method.
  4. By then you will have a trained model that you could use for evaluation on testing data or prediction on new data.
Image result for keras workflow
Keras Model Lifecycle

Core Layers

Keras supports many layers for building our neural network. They are accessible from keras.layers and the following shows the most basic classes we are going to use:

  • Dense: is the standard layer of fully connected neurons
    to the previous layer. It Implements the operation output = activation(X * W
    + bias)
  • Activation: applies an activation function to an output
  • Dropout: applies dropout to the input. Basically, it
    works by randomly deactivation a set of neurons in a given layer according to a
    predefined probability rate. Dropout is used to prevent overfitting
  • Conv2D: Applies a 2D convolution to train a set of kernels
    mainly on image datasets
  • Flatten: Flattens the input into 1D matrix. Mainly used
    after feature extraction in Convolutional neural networks.

Don’t be intimidated by some of the layers, we will learn
them one by one in future posts.

Losses and Optimizers

After defining a model, we need to select a loss function
and an optimizer. The optimizer’s job is to find the best model parameters that
minimizes the loss function.

Available optimizers: SGD, RMSprop, Adagrad, Adadelta, Adam,
Adamax, Nadam

Available loss functions: mean absolute error, mean absolute
percentage error, mean squared. logarithmic error, squared hinge, hinge,
categorical hinge, logcosh, categorical crossentropy, sparse categorical crossentropy,
binary crossentropy, kullback leibler divergence, poisson, cosine proximity.

Explaining how each optimizer and loss function work is out of
the scope this series, if you want to know more about them please visit Keras
official documentation for losses and optimizers.

Keras Utils

Keras provides additional utility functions that facilitates
building and viewing models. We will mainly use them to preprocess data and
viewing models. For more information about the available functions please visit
the official documentation.

Conclusion

This post was a simple introduction to Keras. We introduced the framework, learned about the important classes, the standard workflow and the model lifecycle. In the next post, we will learn how to use Keras to train a linear regression model.


Note: This is a guest post, and opinion in this article is of the guest writer. If you have any issues with any of the articles posted at www.marktechpost.com please contact at [email protected]m 

Related

Related Posts

How Machine Learning has impacted Consumer Behaviour and Analysis
Consumer Research

How Machine Learning has impacted Consumer Behaviour and Analysis

January 4, 2024
Market Research The Ultimate Weapon for Business Success
Consumer Research

Market Research: The Ultimate Weapon for Business Success

June 22, 2023
Unveiling the Hidden Power of Market Research A Game Changer
Consumer Research

Unveiling the Hidden Power of Market Research: A Game Changer

June 2, 2023
7 Secrets of Market Research Gurus That Will Blow Your Mind
Consumer Research

7 Secrets of Market Research Gurus That Will Blow Your Mind

May 8, 2023
The Shocking Truth About Market Research Revealed!
Consumer Research

The Shocking Truth About Market Research: Revealed!

April 25, 2023
market research, primary research, secondary research, market research trends, market research news,
Consumer Research

Quantitative vs. Qualitative Research. How to choose the Right Research Method for Your Business Needs

March 14, 2023
Next Post
Corporate Storytelling and Brand Documentaries: The New Power Couple

Corporate Storytelling and Brand Documentaries: The New Power Couple

Categories

  • Consumer Research
  • Data Analysis
  • Data Collection
  • Industry Research
  • Latest News
  • Market Insights
  • Marketing Research
  • Survey Research
  • Uncategorized

Recent Posts

  • Ipsos Revolutionizes the Global Market Research Landscape
  • How Machine Learning has impacted Consumer Behaviour and Analysis
  • Market Research: The Ultimate Weapon for Business Success
  • Privacy Policy
  • Terms of Use
  • Antispam
  • DMCA

Copyright © 2024 Globalresearchsyndicate.com

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Cookie settingsACCEPT
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these cookies, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may have an effect on your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT
No Result
View All Result
  • Latest News
  • Consumer Research
  • Survey Research
  • Marketing Research
  • Industry Research
  • Data Collection
  • More
    • Data Analysis
    • Market Insights

Copyright © 2024 Globalresearchsyndicate.com