The various loss function used in Artificial Intelligence

Manidhar Kodurupaka
3 min readApr 21, 2021

Considering machine learning and mathematical optimization, loss function plays activate role. Actually, the loss function is the method of evaluating and describes the working of specific data. When there is a lot of predictions comparing the actual results, a very large number is caught. The below figure shows the loss function.

Regression Loss Functions-

In the case of the regression loss function, it helps in predicting the model in knowing how well the model works and awakes the outcome which we expect. Here, Gradient descent is the most commonly used method. In order to find the minimum point gradient descent is used. In the below figure, the classification function predicts a label and the regression function predicts a quantity.

The loss function used in linear regression-

Here, we know that the most frequently used loss function in linear regression is said to be Least Squared Error. It is also said to be called Mean Squared Error. Mentioned below are the formulae of MSE.

Mean Squared Error formulae

The loss function used in logistic regression-

The loss function of logistic regression is said to be Log Loss. It is defined as:

Log Loss = ∑ ( x , y ) ∈ D − y log ⁡ ( y ′ ) − ( 1 − y ) log ⁡

Considering the loss function, we call it Logistic Loss. If y = 1, looking at the plot below on left, when prediction = 1, the cost = 0, when prediction = 0, the learning algorithm is punished by a very large cost.

The loss function used in object detection-

Here, if the object is present in the grid cell then the loss function gets penalized in the classification error. We use the YOLO algorithm in object detection, which is known as You Only Look Once.

After making much research, people found that YOLO is fast in manner.

Loss function used in object detection

The loss function used in machine translation-

In machine translation, the predicted translation and the actual translation

accuracy are compared to compute loss in the input sentence. They are many varieties of loss functions, but the most commonly used one is the Cross-Entropy Loss.

While there are several varieties of loss functions, a very common one to utilize is the Cross-Entropy Loss.

--

--