Questions tagged [loss-functions]

For questions related to the concept of loss (or cost) function in the context of machine learning.

50 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
0answers
14 views

How do weights changes handles during back-propagation when there are unknown labels

I have a question about how weights are updated during back-propagation for some of my samples that have unknown labels (please note, unknown, not missing). The reason they are unknown is because this ...
3
votes
1answer
59 views

when should I create a custom loss function?

Hi I'm using neural network to solve a multi regression problem. I'm trying to predict continuous values, to be more specific I'm making a tracking algorithm to track the position of an Object, I'm ...
3
votes
0answers
46 views

When to use RMSE as opposed to MSE and vice versa?

I understand that RMSE is just the square root of MSE. Generally, as far as I have seen, people seem to use MSE as a loss function and RMSE for evaluation purposes, since it exactly gives you the ...
2
votes
0answers
22 views

Single label classification into hierarchical categories using a neural network

I am working on a classification problem into progressive classes. In other words, there is some hierarchy of categories in such a way, that A < B < C, e.g. low, medium, high, very high. What ...
2
votes
0answers
35 views

Is Mean Squared Error Loss function a good loss function for continuous variables $0 < x < 1$

Suppose I am utilising a neural network to predict the next state, $s'$ based on the current $(s, a)$ pairs. all my neural network inputs are between 0 and 1 and the loss function for this network ...
2
votes
0answers
20 views

Is there any wrong in my focal loss derivation?

Assume $\mathbf{X} \in R^{N, C}$ is the input of the softmax $\mathbf{P} \in R^{N, C}$, where $N$ is number of examples and $C$ is number of classes: $$\mathbf{p}_i = \left[ \frac{e^{x_{ik}}}{\sum_{j=...
2
votes
0answers
30 views

Why does GAN loss converge to log(2) and not -log(2)?

In Goodfellow's paper, he says: Hence, by inspecting Eq. 4 at $D^*_G (\mathbf{x}) = \frac{1}{2}$, we find $C(G) = \log \frac{1}{2}+ \log \frac{1}{2} = − \log 4$. To see that this is the best ...
2
votes
0answers
53 views

Why is the loss associated with my neural network increasing?

I am currently learning neural networks. Using data from http://www.mariofrank.net/touchalytics/index.html, I am trying to predict "User ID" by training the neural network model shown below. However, ...
2
votes
0answers
20 views

Tversky Loss paper implementation: Recall/Precision do not improve as stated

I have been trying to implement this paper and I am very much intrigued. I am working on a medical image problem where I have to segment very small specimens on Whole Slide Images (gigapixel ...
2
votes
0answers
34 views

How to understand my CNN's training results?

I created a multi-label classification CNN to classify chest X-ray images into zero or more possible lung diseases. I've been doing some configuration tests on it and analyzing its results and I'm ...
2
votes
0answers
12 views

Loss function for increasing the quality of the image when labels are not perfectly alligned

I am trying to increse the quality of the images that I gather from the microscope. That is a acoustic microscope and there are lots of technical details but in a nutshell the low quality images and ...
2
votes
0answers
47 views

How to implement loss function of H-GAN model

I was trying to implement the loss function of H-GAN. Here is my code . But it seem somethings wrong, maybe is recognition loss on z (EQ 9). I used the EQ 5 on MISO to calculate it. Here is my code: ...
2
votes
2answers
35 views

Maximize loss on non-target variable

I have a neural network that should be able to classify documents to target label A. The problem is that the network is actually classifying label B, which is an easier task. To make the problem more ...
2
votes
0answers
94 views

CNN clasification model loss stuck at same value

I have CNN model to classify 2 classes. (Yes or No) I use categorical_crossentropy loss and softmax activation at the end. For input I use image with all 3 channels, for output I use One hot encoded ...
2
votes
0answers
59 views

Is it possible to use Reward Function of type R(s, a, s') if more than one action is applied?

I am applying a reinforcement learning agent (PPO2, stable baselines implementation) to a custom built environment using OpenAI Gym. One reward function (formualted as loss function, that is, all ...
2
votes
0answers
86 views

Understanding log probabilities of actions in the PPO objective

I'm trying to implement the Proximal Policy Optimization (PPO) algorithm (code here), but I am confused about certain concepts. What is the correct way to implement log probability of a policy (...
2
votes
0answers
42 views

Which loss functions for transforming a density function to another density function?

I am looking at a problem which can be distilled as follows: I have a phenomenon which can be modeled as a probability density function which is "messy" in that it sums to unity over its support but ...
2
votes
0answers
37 views

Should I use the hyperbolic distance loss in the case of Poincarè Disk Model?

I trained a neural network which makes a regression to a Poincarè Disk Model with radius $r = 1$. I want to optimize using the hyperbolic distance $$ \operatorname{arcosh} \left( 1 + \frac{2|pq|^2|...
2
votes
1answer
236 views

How do I get multiple loss per sample in keras evaluate?

Usually, when I evaluate() a model, I would get a single loss that is already averaged over all samples. How do I get the loss per each sample and return all of them? E.g. if my dataset has 100 ...
2
votes
0answers
236 views

Extend the loss function from the single action to the n-action case per time step

My question concerns a side question (which was not answered) asked here: Policy gradients for multiple continuous actions I am trying to implement a simple policy gradient algorithm for a discrete ...
2
votes
2answers
148 views

Why is MSE used over other quadratic loss functions?

So I was wondering, why I have only encountered square loss function also known as MSE. The only nice property of MSE I am so far aware of is its convex nature. But then all equations of the form $x^{...
1
vote
0answers
13 views

Incorporating domain knowledge into recurrent network

I am currently trying to solve a classification task with a recurrent artificial neural network (RNN). Situation There are up to 350 inputs (X) mapped on one categorical output (y)(13 differnt ...
1
vote
0answers
34 views

How MSE should be appliead with multi target deep network?

I'm having a problem understanding how the MSE should be used when working with a multidimensional target, e.g 3 dimensiones. (My outputs are continuois values, not categorical) Let us say I have a ...
1
vote
1answer
45 views

How does the DQN loss from td_targets against q_values make sense?

Why td_loss is calculated from (td_targets against q_values)? Why I am lost is because: <...
1
vote
0answers
15 views

How to update edge features in a graph using a loss function?

Given a directed, edge attributed graph G, where the edge attribute is a probability value, and a particular node N (with binary features f1 and f2) in G, the algorithm that I want to implement is as ...
1
vote
0answers
20 views

Face recognition model loss not decreasing

I wrote a script to do train a Siamese Network style model for face recognition on LFW dataset but the training loss doesnt decrease at all. Probably there's a bug in my implementation. Could you ...
1
vote
0answers
29 views

How to reduce fluctuation of a neural network?

I've modeled an AlexNet neural network, with 50 epochs and a batch size of 64. I used a stochastic gradient descent optimizer with a learning rate of 0.01. I attached the train and validation loss and ...
1
vote
0answers
15 views

Keras MLP returns always loss 0.0

I'm implementing a multilayer perceptron with Keras to predict the correct words order in a sentence. I'm using train_on_batch()because I convert each sentence in a ...
1
vote
1answer
33 views

RealNVP gives wrong probabilities

I am trying to use RealNVP with some data I have (the input size is a 1D vector of size 22). Here is the link to the RealNVP paper and here is a nice, short explanation of it (the paper is pretty long)...
1
vote
0answers
6 views

Should you use the log of the independent variable to train if you're using RMSLE?

So I'm working on an old Kaggle competition which requires you to predict the price of something, and the evaluation metric used is RMSLE. I found a tutorial for that data set, and the person in the ...
1
vote
0answers
20 views

Using U-NET for image semantic segmentation

If it is not the right place to ask this question, please tell me and I move it to the right place. I'm getting literally crazy trying to understand how U-NET works. Maybe it is very easy but I'm ...
1
vote
0answers
42 views

A generalized quadratic loss and Newton iteration for Support Vector Regression, why doesn't it generalize well?

I'm comparing the results of an Newton optimizer for a modified version of SVM ( a generalized quadratic loss, similar to the one stated in: A generalized quadratic loss for SVM ) with classic SVM^...
1
vote
0answers
21 views

How would the “best function” been constructed if there are no computationally limitations?

I am reading the Wikipedia article on gradient boosting. There is written: Unfortunately, choosing the best function $h$ at each step for an arbitrary loss function $L$ is a computationally ...
1
vote
0answers
46 views

How to interpret a large variance of the loss function?

How do I interpret a large variance of a loss function? I am currently training a transformer network (using the software, but not the model from GPT-2) from scratch and my loss function looks like ...
1
vote
0answers
41 views

What are the loss functions used in teacher-student learning models?

I am not sure what are the common loss functions people usually use when training a student in a teacher-student learning model. Any insight on this is appreciated.
1
vote
0answers
96 views

Could the Jensen-Shannon divergence and Kullback-Leibler divergence be used as loss functions of non-generation problems?

If I understand correctly, the KL divergence is a measure of information loss between a ground truth distribution $P$ and a predicted distribution $Q$, and the Jensen-Shannon divergence is the mean of ...
1
vote
0answers
15 views

Limits for a bottleneck

I have some 64x64 pixels frames from a (simulated) video, with a spaceship moving on a fixed background. The spaceship moves in a straight line with constant velocity from left to right (along the x-...
1
vote
0answers
28 views

Why such a big difference in number between training error and validation error?

Question Why such a big difference between my 'Train loss' and 'Validation loss' as shown in the picture below? Is it a signal that my codes are wrong and my trained network is wrong as well? Some ...
1
vote
0answers
64 views

Unit integral condition on the output layer

I want to train a neural network on some input data from a probability distribution (say a Gaussian). The loss function would normally be $-\sum\log(f(x_i))$, where the sum is over the whole data (or ...
1
vote
0answers
31 views

Add a layer derivative in the loss function

I am writing a NN in pytorch and I want to add the derivative of the output with respect to one of the inner layers in the loss. Here is a simple example of what I mean: ...
1
vote
0answers
47 views

How to understand marginal loglikelihood objective function as loss function (explanation of an article)?

I am reading article https://allenai.org/paper-appendix/emnlp2017-wt/ http://ai2-website.s3.amazonaws.com/publications/wikitables.pdf about training neural network and the loss function is mentioned ...
0
votes
0answers
23 views

Simplifying Log Loss

I am reading through a paper (https://www.mitpressjournals.org/doi/pdf/10.1162/0891201053630273) where they describe logloss as a ranking function and can be simplified to the margin of the training ...
0
votes
0answers
10 views

what will be the best loss function for unet to predict the each pixel values?

I'm predicting the used 9 pictures to predict the last picture so (40,40,9) -> unet -> (40,40,1) but as you see the predict picture It's not just a mask(0or 1) its float so which loss function ...
0
votes
0answers
10 views

Why do code implementations average the loss over a batch instead of finding the expected sample of that batch (using sampling probabilities)

Usually, our training objective over a batch is written in terms of the expected value of a sample in that batch such as $objective = E_{x \sim data} * log(P(x))$ But in the code implementations, ...
0
votes
0answers
22 views

Can neural networks handle redundant inputs?

I have a fully connected neural network with the following number of neurons in each layer [4, 20, 20, 20, ..., 1]. I am using TensorFlow and the 4 real-valued ...
0
votes
0answers
25 views

How should I define the loss function when using DQN to estimate the probability density?

I'm doing a Deep Q-learning project. All of my rewards are positive and there are two terminal states. One of them has a zero reward and the other has a high positive reward. The rewards are ...
0
votes
1answer
37 views

How do you perform a gradient based adversarial attack on an SVM based model?

I have an SVM currently and want to perform a gradient based attack on it similar to FGSM discussed in Explaining And Harnessing Adversarial Examples. I am struggling to actually calculate the ...
0
votes
0answers
21 views

Deduce properties of the loss functions from the training loss curves

I have two convex, smooth loss functions to minimise. During the training (a very simple model) using batch SGD (with tuned optimal learning rate for each loss function), I observe that the (log) loss ...
0
votes
0answers
29 views

Outliers detection problem in neural networks

Assuming we have big m x n input dataset with m x 1 output vector. It's a classification problem with only two possible values: either 1 or 0. Now the problem is that almost all elements of the output ...
0
votes
1answer
150 views

Artifacts After pruning Unet CNN

Im trying to make a dark image brighter using CNN-UNet arcitecture. When I train the network I get the following results: When I cut the features in half for pruning, and do full train again, I get ...