EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login
Home Data Science Data Science Tutorials Machine Learning Tutorial Deep Learning Model
Secondary Sidebar
Machine Learning Tutorial
  • Deep Learning
    • What Is Deep learning
    • Overviews Deep Learning
    • Application of Deep Learning
    • Careers in Deep Learnings
    • Deep Learning Frameworks
    • Deep Learning Model
    • Deep Learning Algorithms
    • Deep Learning Technique
    • Deep Learning Networks
    • Deep Learning Libraries
    • Deep Learning Toolbox
    • Types of Neural Networks
    • Convolutional Neural Networks
    • Create Decision Tree
    • Deep Learning for NLP
    • Caffe Deep Learning
    • Deep Learning with TensorFlow
  • Basic
    • Introduction To Machine Learning
    • What is Machine Learning?
    • Uses of Machine Learning
    • Applications of Machine Learning
    • Naive Bayes in Machine Learning
    • Dataset Labelling
    • DataSet Example
    • Deep Learning Techniques
    • Dataset ZFS
    • Careers in Machine Learning
    • What is Machine Cycle?
    • Machine Learning Feature
    • Machine Learning Programming Languages
    • What is Kernel in Machine Learning
    • Machine Learning Tools
    • Machine Learning Models
    • Machine Learning Platform
    • Machine Learning Libraries
    • Machine Learning Life Cycle
    • Machine Learning System
    • Machine Learning Datasets
    • Machine Learning Certifications
    • Machine Learning Python vs R
    • Optimization for Machine Learning
    • Types of Machine Learning
    • Machine Learning Methods
    • Machine Learning Software
    • Machine Learning Techniques
    • Machine Learning Feature Selection
    • Ensemble Methods in Machine Learning
    • Support Vector Machine in Machine Learning
    • Decision Making Techniques
    • Restricted Boltzmann Machine
    • Regularization Machine Learning
    • What is Regression?
    • What is Linear Regression?
    • Dataset for Linear Regression
    • Decision tree limitations
    • What is Decision Tree?
    • What is Random Forest
  • Algorithms
    • Machine Learning Algorithms
    • Apriori Algorithm in Machine Learning
    • Types of Machine Learning Algorithms
    • Bayes Theorem
    • AdaBoost Algorithm
    • Classification Algorithms
    • Clustering Algorithm
    • Gradient Boosting Algorithm
    • Mean Shift Algorithm
    • Hierarchical Clustering Algorithm
    • Hierarchical Clustering Agglomerative
    • What is a Greedy Algorithm?
    • What is Genetic Algorithm?
    • Random Forest Algorithm
    • Nearest Neighbors Algorithm
    • Weak Law of Large Numbers
    • Ray Tracing Algorithm
    • SVM Algorithm
    • Naive Bayes Algorithm
    • Neural Network Algorithms
    • Boosting Algorithm
    • XGBoost Algorithm
    • Pattern Searching
    • Loss Functions in Machine Learning
    • Decision Tree in Machine Learning
    • Hyperparameter Machine Learning
    • Unsupervised Machine Learning
    • K- Means Clustering Algorithm
    • KNN Algorithm
    • Monty Hall Problem
  • Supervised
    • What is Supervised Learning
    • Supervised Machine Learning
    • Supervised Machine Learning Algorithms
    • Perceptron Learning Algorithm
    • Simple Linear Regression
    • Polynomial Regression
    • Multivariate Regression
    • Regression in Machine Learning
    • Hierarchical Clustering Analysis
    • Linear Regression Analysis
    • Support Vector Regression
    • Multiple Linear Regression
    • Linear Algebra in Machine Learning
    • Statistics for Machine Learning
    • What is Regression Analysis?
    • Clustering Methods
    • Backward Elimination
    • Ensemble Techniques
    • Bagging and Boosting
    • Linear Regression Modeling
    • What is Reinforcement Learning
  • Classification
    • Kernel Methods in Machine Learning
    • Clustering in Machine Learning
    • Machine Learning Architecture
    • Automation Anywhere Architecture
    • Machine Learning C++ Library
    • Machine Learning Frameworks
    • Data Preprocessing in Machine Learning
    • Data Science Machine Learning
    • Classification of Neural Network
    • Neural Network Machine Learning
    • What is Convolutional Neural Network?
    • Single Layer Neural Network
    • Kernel Methods
    • Forward and Backward Chaining
    • Forward Chaining
    • Backward Chaining
  • RPA
    • What is RPA
    • What is Robotics?
    • Benefits of RPA
    • RPA Applications
    • Types of Robots
    • RPA Tools
    • Line Follower Robot
    • What is Blue Prism?
    • RPA vs BPM
  • Interview Questions
    • Deep Learning Interview Questions And Answer
    • Machine Learning Cheat Sheet

Related Courses

Machine Learning Training

Deep Learning Training

Artificial Intelligence Training

Deep Learning Model

By Priya PedamkarPriya Pedamkar

Deep Learning Model

Introduction to Deep Learning Model

Deep learning models usually consume a lot of data, the model is always complex to train with CPU, GPU processing units are needed to perform training. So when GPU resource is not allocated, then you use some machine learning algorithm to solve the problem. Deep learning models would improve well when more data is added to the architecture. Deep Learning models can be trained from scratch or pre-trained models can be used. Sometimes Feature extraction can also be used to extract certain features from deep learning model layers and then fed to the machine learning model.

How to Create Deep Learning Model?

Deep Learning Model is created using neural networks. It has an Input layer, Hidden layer, and output layer. The input layer takes the input, the hidden layer process these inputs using weights that can be fine-tuned during training, and then the model would give out the prediction that can be adjusted for every iteration to minimize the error. For example, you can create a sequential model using Keras whereas you can specify the number of nodes in each layer.

Example:

from keras.models import Sequential
from keras.layers import Dense
model = Sequential()
model.add(dense(10,activation='relu',input_shape=(2,)))
model.add(dense(5,activation='relu'))
model.add(dense(1,activation='relu'))

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

The activation function allows you to introduce non-linearity relationships. You can specify the input layer shape in the first step wherein 2 represents no of columns in the input, also you can specify no of rows needed after a comma. The output layer has only one node for prediction. The purpose of introducing an activation function is to learn something complex from the data provided to them. This function should be differentiable, so when back-propagation happens, the network will able to optimize the error function to reduce the loss for every iteration. Weights are multiplied to input and bias is added.

Functions of Deep Learning

Here are the functions which we are using in deep learning:

using in deep learning

1. Sigmoid Activation Function

The function is of the form f(x) = 1/1+exp(-x). The output lies between 0 and 1. It’s not zero centered. The function suffers from vanishing gradient problem. When back-propagation happens, small derivatives are multiplied together, as we propagate to the initial layers, the gradient decreases exponentially.

All in One Data Science Bundle(360+ Courses, 50+ projects)
Python TutorialMachine LearningAWSArtificial Intelligence
TableauR ProgrammingPowerBIDeep Learning
Price
View Courses
360+ Online Courses | 50+ projects | 1500+ Hours | Verifiable Certificates | Lifetime Access
4.7 (86,584 ratings)

2. Hyperbolic Tangent Function(tan-h)

The function is of the form f(x) = 1-exp(-2x)/1+exp(2x) . The output lies between -1 and +1. Its zero centered. Optimization convergence is easy when compared to Sigmoid function, but the tan-h function still suffers from vanishing gradient problem.

3. Relu(Rectified Linear Units)

The function is if form f(x) = max(0,x) 0 when x<0, x when x>0. Relu convergence is more when compared to tan-h function. The function does not suffer from vanishing gradient problem. It can be used only within hidden layers of the network. Sometimes the model suffers from dead neuron problem which means a weight update can never be activated on some data points. In that leaky Relu function can be used to solve the problems of dying neurons. So it’s better to use Relu function when compared to Sigmoid and tan-h interns of accuracy and performance.

Next model is complied using model.compile(). It has parameters like loss and optimizer. Loss functions like mean absolute error, mean squared error, hinge loss, categorical cross-entropy, binary cross-entropy can be used depending upon the objective function. Optimizer functions like Adadelta, SGD, Adagrad, Adam can also be used.

4. Loss Functions

Here are the types of loss functions explained below:

  • MAE(Mean Absolute Error): It is one of evaluation metric which calculates the absolute difference between predicted and actual values. Take the sum of all absolute differences and divide it by the number of observations. It does not penalize large values so high as compared to MSE, which means that they are sensitive to outliers.
  • MSE(Mean Squared Error): MSE is calculated by the sum of squares of the difference between predicted and actual values and dividing it by the number of observations. It needs attention when the metric value is higher or lower. Useful only when we unexpected values for predictions. We cannot rely on MSE because sometimes when the model is performing well, it may have a high MSE.
  • Hinge Loss: This function is mostly used in support vector machines. The function is of form =[0,1-yf(x)]. when yf(x)>=0 the loss function is 0, but when yf(x) < 0 the error increases exponentially penalizing more to the mis-classified points that are distant from the margin. So the error would increase exponentially to those points.
  • Cross-Entropy: Its a log function that predicts value lies between 0 and 1. It measures the performance of a classification model. thus when the value is 0.010 the cross-entropy loss is more and the model is bad in terms of prediction. For binary classification, cross-entropy loss is defined by -(ylog(p)+(1-y)log(1-p)). For Multi Classification, the cross-entropy loss is defined by summations of -ylog(p).

5. Optimizer Functions

Here are the types of optimizer functions explained below:

  • SGD: Stochastic Gradient Descent has a problem with convergence stability. Local Minimum problem arises here. There is more fluctuation in loss functions therefore calculating the global minimum is a tedious task.
  • Adagrad: Here in this Adagrad function, there is no need to manually tune the learning rate. But the main disadvantage is that the learning rate keeps on decreasing. So when the learning rate is shrinking too much for every iteration the model does not acquire additional knowledge after that. This decreasing learning rate is solved in Adadelta.
  • Adadelta: Here decreasing learning rate is being solved, different learning rates are calculated for every parameter and momentum is being calculated. But the main thing is that this will not store individual momentum levels for each parameter. This problem is rectified in Adam’s optimizer function.
  • Adam(Adaptive Moment Estimation): Convergence rates are high when compared to other adaptive models. Takes care of adaptive learning rates for every parameter. Mostly used in all deep learning models as momentum is also considered for each parameter. Adam’s model is very efficient and high speed. So the model can be trained with the model.fit() function where you can specify the training x parameters and y parameter, no of epochs to run, training, and testing data split. Finally, the model.predict() function would predict the outcome when sample input is passed into this function.

Conclusion

So finally the deep learning model helps to solve complex problems whether the data is linear or nonlinear. The model keeps acquiring knowledge for every data that has been fed to it.

Recommended Articles

This is a guide to Deep Learning Model. Here we discuss how to create a Deep Learning Model along with a sequential model and various functions. You can also go through our suggested articles to learn more –

  1. Working of Deep Learning Networks
  2. Application of Deep Learning
  3. Deep Learning Algorithms
  4. What is Deep learning?
Popular Course in this category
Deep Learning Training (18 Courses, 24+ Projects)
  18 Online Courses |  24 Hands-on Projects |  145+ Hours |  Verifiable Certificate of Completion
4.5
Price

View Course

Related Courses

Machine Learning Training (20 Courses, 29+ Projects)4.9
Artificial Intelligence AI Training (5 Courses, 2 Project)4.8
0 Shares
Share
Tweet
Share
Primary Sidebar
Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Live Classes
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

ISO 10004:2018 & ISO 9001:2015 Certified

© 2022 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA
Free Data Science Course

SPSS, Data visualization with Python, Matplotlib Library, Seaborn Package

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA Login

Forgot Password?

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you

By signing up, you agree to our Terms of Use and Privacy Policy.

Let’s Get Started

By signing up, you agree to our Terms of Use and Privacy Policy.

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

Loading . . .
Quiz
Question:

Answer:

Quiz Result
Total QuestionsCorrect AnswersWrong AnswersPercentage

Explore 1000+ varieties of Mock tests View more