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
6 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
12 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
160 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
69 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
26 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
103 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
99 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
27 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
29 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
38 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
1answer
71 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
90 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
32 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
44 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
28 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
42 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
377 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
57 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
149 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
150 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
1k 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
112 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
123 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 ...
1
vote
0answers
113 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
258 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
113 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
916 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
29 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
154 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
487 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
199 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 ...
4
votes
2answers
219 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
28 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
72 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 ...
5
votes
1answer
513 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
94 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
95 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
57 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: ...
5
votes
1answer
2k 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(...
0
votes
1answer
109 views

Difference between Empirical distribution and Bernoulli distribution

I've been studying binary cross entropy error for binary classification weight optimization. From my knowledge, Cross entropy itself quantifies divergence between two probability distributions with ...
0
votes
0answers
23 views

Can cross entropy be employed for measuring effective mapping of cross-modal data?

I am working on a new metric for cross-modal retrieval which can measure the effectiveness of mapping two modalities on a manifold. However, the usual approach is to employ a distance metric and not ...
1
vote
1answer
94 views

Cross-entropy yields strange results when neural network gets too sure about his outputs

I'm using a classical CNN for image binary classification. Output is composed of two neurons, each giving the network's "raw output" for the 2 classes. So for an image, it would be eg $(0.62, -0.52)$. ...
1
vote
1answer
55 views

CNN with categorical response - how is “other” or “null” classes represented in output?

I have a created a Convolution Neural Network in Keras for an image classification problem. The purpose of the CNN is to identify whether either of the two classes (e.g. dog and cat) is present in ...
1
vote
0answers
96 views

Alternative measurement for Cross Entropy Loss than accuracy when using soft labeling?

Suppose one has multi-class ($n>2$) data, where class labels are soft, e.g. two samples of for 3-classed data might look like: ...
0
votes
0answers
125 views

change hinge loss error function with cross-entropy

I'm trying to implement cross-entropy as an error function in RBF neural networks instead of hinge loss error function. I need to find cross-entropy error for each output neuron, like hinge loss error ...
0
votes
0answers
62 views

Regression tree with cross-entropy loss

I need to predict the categorical distribution with the decision tree. Formally there is a map $ f: X \rightarrow \{(p_1, ..., p_k): p_i \geq 0, \, \text{and} \sum_i p_i = 1\}$ defined on the given ...
0
votes
1answer
207 views

How is the Cross-Entropy Cost Function back-propagated?

I've looked at a few threads about this but they've not been exactly what I'm after. When back-propagating the quadratic cost function, you first find the output error from $\delta_L = \...