Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is pytorch Cross Entropy loss function

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly explains "what is the pytorch cross-entropy loss function". Interested friends may wish to take a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "what is the pytorch cross-entropy loss function"?

Catalogue

1. Derivation of Cross Entropy loss function

two。 Intuitive understanding of Cross Entropy loss function

3. Other forms of Cross Entropy loss function

Speaking of the cross-entropy loss function "Cross Entropy Loss", its formula immediately comes to mind:

We are already very familiar with this cross-entropy function, and in most cases we just use it directly. But where did it come from? Why can it represent the difference between the real sample label and the predicted probability? Are there any other variants of the cross-entropy function above?

1. Derivation of Cross Entropy loss function

We know that in the binary classification problem model, such as logical regression "Logistic Regression", neural network "Neural Network" and so on, the label of the real sample is [0jue 1], which represents negative class and positive class respectively. At the end of the model, a Sigmoid function is usually used to output a probability value, which reflects the possibility of being predicted as a positive class: the greater the probability, the greater the probability.

The expression and graph of the Sigmoid function are as follows:

Where s is the output of the upper layer of the model, and the Sigmoid function has the following characteristics: when s = 0, g (s) = 0.510 s > > 0, g ≈ 1m s

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report