Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [cross-entropy]

The tag has no usage guidance.

0
votes
0answers
7 views

How to interpret when using hinge loss performs a lot better than cross-entropy loss in a multi-class clasification problem?"

Given that hinge loss is based on the marginal loss in SVM, is there any reasonable assumption / interpretation one can make on the topology of the dataset, when using multi-class hinge loss ...
0
votes
0answers
14 views

How to compute weight change for hidden layers with cross-entropy loss? [duplicate]

I'm trying to train a neural net with 1 hidden layer (RELU) softmax output layer cross-entropy loss stochastic gradient descent My implementation seems to work fine when I don't use any hidden ...
0
votes
0answers
7 views

Cross-Entropy Cost Function : Why to apply partial derivative twice? [closed]

Here my question is Why do we need to apply partial derivative twice on the cross entropy cost function? Why not only single time ? Here is the image for reference:
0
votes
0answers
10 views

How does cross entropy loss get calculated in overconfident neural networks?

Given formula for categorical formula for cross entropy: or binary forumla: how is cross entropy calculated in overconfident neural netowrks (especially CNNs where this phenomenon is common), e.g. ...
0
votes
1answer
22 views

Softmax with Cross Entropy optimization vs Backpropagation

I am following a tutorial from Analytics Vidhya on creating a neural network to recognize handwritten digits (the classic example). The code from the tutorial states "First we need to define the ...
0
votes
2answers
21 views

Binary cross-entropy: plugging in probability 0

There is an answer on the Kaggle question board here by Dr. Fuzzy: ...
2
votes
0answers
42 views

Name/definition of $\int \log F(x) \cdot g(x)dx$?

We know that: $$-\int \log f(x) \cdot g(x)dx,$$ where $f$ and $g$ are density functions, is known as the cross entropy. Does $$-\int \log F(x) \cdot g(x)dx,$$ where $F$ is the cumulative ...
0
votes
0answers
16 views

Label smoothing formula

I recently came across this paper in section 3.2 it talks about label smoothing loss and how it's equivalent to s equivalent to adding the KL divergence between the uniform distribution u and the ...
0
votes
0answers
9 views

What should the form of error be on CrossEntropy or KL-divergence loss function across samples of distributions?

Suppose your model produces (discrete) probability distributions and you have some truth distributions you want to compare to. For each sample $i$, you can compute the loss as the KL divergence or ...
0
votes
0answers
16 views

Deriving gradient of cross entropy from the cross entropy

I was trying to derive the third equation from the cross entropy of a conditional bernoulli distribution. But I just can't seem to find out how gradient $\mathbf z^{(i)}$ came out. Can someone please ...
0
votes
0answers
32 views

Neural Networks output functions [duplicate]

Studying about neural networks as a newbie, I learned (I think) about the different types of output functions, but I have been confused when to use each. (softmax, cross-entropy, sigmoid, none) For ...
0
votes
1answer
16 views

Analytical expression of the minimizer of cross entropy loss when the predicted function is a constant fucntion?

Let $\{y_1...y_n\} \in \{0,1\}$, and let $c \in [0,1]$. Define the cross-entropy of loss of $c$ by: $$C(c): = \sum_{j=1}^{n}- y_j ln c - (1- y_j) ln (1-c) $$. Define $c*= arg min _{c} C(c)$ Is ...
2
votes
3answers
270 views

Why is binary cross entropy (or log loss) used in autoencoders for non-binary data

I am working on an autoencoder for non-binary data ranging in [0,1] and while I was exploring existing solutions I noticed that in many people (e.g., the keras ...
1
vote
2answers
107 views

Convexity of cross entropy

I am not sure if this is a better fit for this site or mathematics.stackexchange but I've seen similar questions on here before. I'd like to know if the following is true and if so, how I could go ...
0
votes
0answers
33 views

my CNN predict all 0 or all 1 in multi label classification problem

I am trying to build a CNN for classifying multiple objects in images. I'm on keras and I use the COCO dataset. my net takes in input a 256x256 image and outputs the vector of the predictions of each ...
1
vote
0answers
215 views

In multiclass classification with K classes does cross entropy loss need K outputs or K-1?

Hastie's "The Elements of Statistical Learning" textbook defines the probabilistic model of multiclass logistic regression with K classes as $\forall k \in \{1, \dots, K-1\} $ $$ \ln \frac{p(G=k \mid ...
1
vote
1answer
266 views

cross entropy loss max value

The cross entropy loss function for multiclass can be computed as: $$-\sum\limits_{i=1}^N y_i log \hat{y}_i$$ where $y_i$ is a class and $\hat{y}_i$ the estimated probability. The minimum value is $0$ ...
0
votes
0answers
28 views

how to consider some miss classifications “half correct” in categorical_crossentropy - for a trading system

I have a trading system where the model receives 9 time-series and predict : A - strong down B - week down C - neutral D - week up E - strong up (these classes ...
1
vote
1answer
31 views

Why is loss treated as 0 or infinity here?

I'm reading a beginner's book about deep learning and in the introduction, the following cautionary tale is written: Now, assume that you built a classifier and trained it to predict if a mushroom ...
0
votes
0answers
162 views

loss='categorical_crossentropy' VS loss=K.categorical_crossentropy

Why I have very different loss values in training using these two lines code to define the loss function? ...
0
votes
2answers
280 views

Softmax Loss vs Binary Loss for classification?

I was trying to understand the final section of the paper "Revisiting Baselines for Visual Question Answering". Authors state that their model performs better with a binary loss in comparison to a ...
0
votes
0answers
127 views

Cross entropy vs KL divergence and SGD

I was told recently that stochastic gradient descent can be used to minimize a cross entropy objective function but not a KL-divergence one, even if the two minimization problems are equivalent, ie $...
0
votes
0answers
40 views

Cross - entropy for two variables with different prob. distributions

Let us say that we have given two random variables with different prob. distributions: A = [0.1, 0, 0.5, ...] B = [0.3, 0.1, 0.03, ...] What should I do when I want to compute the reformulated cross-...
0
votes
1answer
57 views

Approach to prevent bias/racism in neural network fitting?

I have a dataset comprised of different ethnic groups and I want to build a classification model on this data. When I do this I find that the performance of the algorithm is better on some groups than ...
0
votes
1answer
50 views

Cross entropy loss: inconsistency in formula

I have a couple of problems trying to understand the exact formula for cross entropy loss. Depending on the source I see it written different ways. Is the log() function $\log_2()$? Is the argument ...
1
vote
0answers
35 views

Binary cross etropy loss with non binary ground truth data [closed]

Is it possible to use binary cross etropy loss with non binary ground truth data, i.e. not [0,1] values, but [0,0.1,0.5,1.0] ...
2
votes
1answer
49 views

Relative Entropy decomposition

Can the relative entropy (Kullback Leibler divergence) between multivariate distributions be decomposed into relative entropies of the different variables plus some measure of dependence between the ...
0
votes
0answers
441 views

Gradient of the cross entropy loss function

I have been puzzled by how to calculate the derivative of the following cross entropy loss function underlying my neural network: CEloss = $\frac{-1}{N} \sum_{n=1}^{N} \sum_{k=1}^{K} t_{n,k} \log y_{...
0
votes
1answer
60 views

Cross Entopy Loss for classification

Suppose I have a neural network, which classifies pictures of cats, dogs and fishes. The neural network uses Softmax as an activation function of the output layer. Let's say I feed a picture of dog ...
1
vote
1answer
186 views

Interpretation of learning curve (training & validation)

I know what a learning curve representative of an "ideal" overfitting looks like. However, I am not 100% sure how to interpret the learning curve shown below. Why does the model sometimes seem to "...
1
vote
0answers
189 views

How to construct a cross-entropy loss for general regression targets?

It's common short-hand in neural networks literature to refer to categorical cross-entropy loss as "cross-entropy," even though there are a number of loss functions which could properly be described ...
2
votes
1answer
2k views

Cross Entropy Loss for One Hot Encoding

CE-loss sums up the loss over all output nodes $\sum_i[ - target_i*\log(output_i) ]$. The derivative of CE-loss is: $- \frac{target_i}{output_i}$. Since for a target=0 the loss and derivative of ...
0
votes
1answer
150 views

Feed-forward neural network (MSE and Cross-entropy) questions

Question 1 Why do we divide by the number of data points (N)? I think it's done to minimize the error being back-propagated, but can't we just don't do that and instead decrease the learning rate to ...
2
votes
1answer
165 views

Difference of notation between cross entropy and joint entropy

Although it is clear to me, how the two concepts differs, it has been difficult for me to find a notation that would make it clear, to which type of entropy we refer. From wikipedia, we can see that ...
2
votes
0answers
145 views

How can I maximise binary cross entropy loss?

I have a multi-task learning model with two binary classification tasks. One part of the model creates a shared feature representation that is fed into two subnets in parallel. The loss function for ...
4
votes
1answer
323 views

Why is cross entropy not a common evaluation metric for model performance?

When we train a classifier, we use cross entropy as a loss function and, for example, an F-Score as an evaluation metric, but why? Why not use cross entropy on the test set to evaluate the model ...
3
votes
1answer
156 views

Why is the cross-entropy always more than the entropy?

I understand intuitively why cross-entropy is always bigger. However, could someone show that mathematically?
3
votes
1answer
1k views

Why binary crossentropy can be used as the loss function in autoencoders?

I was wondering why binary crossentropy can be used as the loss function in autoencoders trained on (normalized) images, e.g. here or this paper? I know that binary crossentropy can be used in binray ...
0
votes
0answers
38 views

How to calculate negative log-likelihoog on MNIST dataset? [duplicate]

This table is from Professor Forcing: A New Algorithm for Training Recurrent Networks paper. I couldn't find their code to calculate NLL. I would like to ask if it is simply the binary cross-entropy. ...
2
votes
1answer
221 views

Does it make sense to use `logit` or `softplus` loss for binary classification problem?

With $z$ is the logit, $p \in \{1, 0\}$ is the class. Usually binary classification problem use sigmoid and cross-entropy to compute loss: $$\mathcal{L_1} = - \sum{p \log \sigma(z) + (1-p) \log \sigma(...
1
vote
1answer
651 views

Is there an alternative to categorical cross-entropy with a notion of “class distance”?

I have a signal $ x \in \mathbb{R}^{t \times l} $ which is discretized into $ l = 32 $ levels for $ t = 100000 $ time points. This enables me to turn a regression problem into a classification problem,...
1
vote
1answer
264 views

Why does cross entropy loss for validation dataset deteriorate far more than validation accuracy when a CNN is overfitting?

I have noticed that the cross-entropy loss for validation dataset deteriorates after a certain number of epochs when training CNN's or MLP's. This is, of course, the sign that the network is ...
5
votes
2answers
314 views

Why we use log function for cross entropy?

I'm learning about a binary classifier. It uses the cross-entropy function as its loss function. $y_i \log p_i + (1-y_i) \log(1-p_i)$ But why does it use the log function? How about just use linear ...
1
vote
0answers
39 views

Describing relative performance of models on the basis on log-loss / cross-entropy

Suppose I train classification algorithms on a given dataset with three model specifications: A, B, and C. On validation data, model A has an average log-loss of 1.0, model B has a log-loss of 0.75, ...
1
vote
1answer
77 views

Maximum likelihood estimation and $\log(0)$

I am thinking I can't be the only one encountering this. I am trying to do maximum likelihood estimation on a probit model, i.e. trying to find the most optimal fit for three parameters in my case ...
6
votes
1answer
652 views

the relationship between maximizing the likelihood and minimizing the cross-entropy

There is a statement that maximizing the likelihood is equivalent to minimizing the cross-entropy. Are there any proof for this statement?
0
votes
0answers
102 views

Computing Gini index and cross-entropy for a dendrogram

I am trying to calculate purity of clusters obtained through hierarchical clustering. I followed this tutorial here: Decision tree learning My question is: is computing these measures the same for ...
1
vote
1answer
106 views

Proof for the efficiency of Softmax in multi-classification

I already search for this question but I can't find any convincing explanation so I want to ask it here. my problem is with softmax activation function and cross-entropy.why they can produce a better ...
0
votes
1answer
59 views

What is the correct answer for cross entropy in this case?

I have two neural networks: NN1 and NN2, predicting Dog and Cat. The probabilities are below: ...
6
votes
2answers
3k views

What is the difference Cross-entropy and KL divergence?

Both of Cross-entropy and KL divergence are tools to measure the distance between two probability distribution. What is the difference? $$ H(P,Q) = -\sum_x P(x)\log Q(x) $$ $$ KL(P | Q) = \sum_{x} P(...