alternative
  • Home (current)
  • About
  • Tutorial
    Technologies
    C#
    Deep Learning
    Statistics for AIML
    Natural Language Processing
    Machine Learning
    SQL -Structured Query Language
    Python
    Ethical Hacking
    Placement Preparation
    Quantitative Aptitude
    View All Tutorial
  • Quiz
    C#
    SQL -Structured Query Language
    Quantitative Aptitude
    Java
    View All Quiz Course
  • Q & A
    C#
    Quantitative Aptitude
    Java
    View All Q & A course
  • Programs
  • Articles
    Identity And Access Management
    Artificial Intelligence & Machine Learning Project
    How to publish your local website on github pages with a custom domain name?
    How to download and install Xampp on Window Operating System ?
    How To Download And Install MySql Workbench
    How to install Pycharm ?
    How to install Python ?
    How to download and install Visual Studio IDE taking an example of C# (C Sharp)
    View All Post
  • Tools
    Program Compiler
    Sql Compiler
    Replace Multiple Text
    Meta Data From Multiple Url
  • Contact
  • User
    Login
    Register

Deep Learning - ANN - Artificial Neural Network - Loss Function Tutorial

Loss Function-

The loss function is a method of evaluating how well your algorithm is modeling your dataset.

If your loss function value is high, then basically loss function is performing poorly. If your loss function value is low, then basically loss function is performing great.

 

Loss Function in Deep Learning- (Please check in Machine Learning Notes)

1] Regression

  • Mean Squared Error
  • Mean Absolute Error
  • Huber Loss

2] Classification

  • Binary Cross Entropy
  • Categorical Cross Entropy
  • Hinge Loss

3] Autoencoders

  • KL Divergence

4] GAN

  • Discriminator Loss
  • Min Max GAN Loss

5] Object Detection

  • Focal Loss

6] Embedding

  • Triplet Loss

Loss Function(Error Function) VS Cost Function

 

1] Regression

a) MSE- Mean Square error(if no outlier)

Advantages-

- Easy to Interpret

- Differentiable ( Gradient Descent )

- 1 Local Minima

Disadvantages-

- Error Unit (Squared) is different

- Not Robust to Outliers

 

b) MAE – Mean Absolute Error (if outlier)

 

Advantages-

- Intuitive and easy

- Unit same

- Robust to Outlier

Disadvantages-

- Not Differentiable

 

c) Huber Loss – if 25% point is an outlier

\(L= \begin{cases} \frac{1}{2} (Y - Y')^2 & \quad \text{for |Y - Y'| <= }\delta\\ \delta|Y - Y'| - \frac{1}{2}\delta^2 & \quad \text{otherwise} \end{cases} \)

If data has an outlier, then Huber loss will act as a Mean Absolute Error.

If not, then it acts as a Mean Squared Error.

 

1] Classification

a) BCE - Binary Cross Entropy (if 2 classes)

Used in classification and has only two classes.

Loss Function = -Y log(Y') - (1 - Y) log(1 - Y')

Y -> Actual Value/Target

Y' -> Predicted Value

The activation function can only be Sigmoid of Output.

Cost Function = \(-\frac{1}{n}[ \displaystyle\sum_{i=1}^{n}(Y_i log(Y_i') + (1 - Y_i) log(1 - Y_i'))]\)

Advantages-

- Differentiable

Disadvantages-

- Multi Local Minima

- Intuitive

 

b) CCE – Categorical Cross Entropy( if more than 2 class)

used in Softmax Regression and Multi-Class Classification

Cost Function = \(- \displaystyle\sum_{j=1}^{k}(Y_j log(Y_j')\)

where k is # classes in the data

 

SCE – Sparse Cross Entropy( if more than 2 class)

 

Deep Learning

Deep Learning

  • Introduction
  • LSTM - Long Short Term Memory
    • Introduction
  • ANN - Artificial Neural Network
    • Perceptron
    • Multilayer Perceptron (Notation & Memoization)
    • Forward Propagation
    • Backward Propagation
    • Perceptron Loss Function
    • Loss Function
    • Gradient Descent | Batch, Stochastics, Mini Batch
    • Vanishing & Exploding Gradient Problem
    • Early Stopping, Dropout. Weight Decay
    • Data Scaling & Feature Scaling
    • Regularization
    • Activation Function
    • Weight Initialization Techniques
    • Optimizer
    • Keras Tuner | Hyperparameter Tuning
  • CNN - Convolutional Neural Network
    • Introduction
    • Padding & Strides
    • Pooling Layer
    • CNN Architecture
    • Backpropagation in CNN
    • Data Augmentation
    • Pretrained Model & Transfer Learning
    • Keras Functional Model
  • RNN - Recurrent Neural Network
    • RNN Architecture & Forward Propagation
    • Types Of RNN
    • Backpropagation in RNN
    • Problems with RNN

About Fresherbell

Best learning portal that provides you great learning experience of various technologies with modern compilation tools and technique

Important Links

Don't hesitate to give us a call or send us a contact form message

Terms & Conditions
Privacy Policy
Contact Us

Social Media

© Untitled. All rights reserved. Demo Images: Unsplash. Design: HTML5 UP.