Questions tagged [loss]

For questions related to the concept of loss (or cost) in machine learning or other AI sub-fields.

Filter by
Sorted by
Tagged with
0 votes
0 answers
10 views

How does one define an "undefined" target?

I was reading a paper that provides this chart for the generation of targets (confidence & displacements). Notice how the red rectangle is undefined outside of the -4 and 4 value for ...
user avatar
  • 3
0 votes
0 answers
19 views

unable to calculate cross entropy loss due to shape of output and target in a transformer model [closed]

I am trying to create a transformer that generates melody from MIDI files. However, I got this error when I run this code: ValueError: Expected input batch_size (49) to match target batch_size (7). ...
user avatar
  • 9
0 votes
0 answers
11 views

Why do we subtract logsumexp from the outputs of this neural network?

I'm trying to understand this tutorial for Jax. Here's an excerpt. It's for a neural net that is designed to classify MNIST images: ...
user avatar
  • 121
2 votes
1 answer
70 views

What is being optimized with WGAN loss? Is the generator maximizing or minimizing the critic value?

I am kind of new to the field of GANs and decided to develop a WGAN. All of the information online seems to be kind of contradicting itself. The more I read, the more I become confused, so I'm hoping ...
user avatar
0 votes
1 answer
14 views

Visualizing the loss landscape in deep NN to compare optimization methods

I'm comparing 2 optimization algorithms for deep neural nets through visualizing the loss landscape. The visualization method is described here. Besides the qualitative observation that how trajectory ...
user avatar
  • 141
0 votes
2 answers
29 views

What does IOU3 mean in this context?

I was reading a paper and this paragraph said that: The ground truth score is calculated based on the intersectionover- union (IoU) of the perturbed image and the ground truth one. Since we would ...
user avatar
  • 3
0 votes
2 answers
63 views

What is the domain of the discriminator of a GAN?

I've read that the discriminator $D$ validates an image $D(x)$, where $x$ is either a real image or a fake one created by the generator, i.e. $ D(G(x))$. What does the function of the discriminator ...
user avatar
1 vote
1 answer
105 views

PPO: policy loss becomes nan [closed]

I'm implement PPO for a very specific problem, and it seems to be working somewhat, but after a few epochs, I always get something like this: ...
user avatar
0 votes
1 answer
51 views

YearPrediction dataset for a regression task: is it possible to evaluate a fair comparison between standard loss and a quadratic one?

We are trying to evaluate a loss function on the Year Prediction (Million Songs) data set. The problem is that we don't know how to configure an experiment in order to test if one loss (the standard ...
user avatar
0 votes
0 answers
17 views

If two functions are close apart can I proof the difference of their empirical loss is also small?

I am trying to understand the proof of Theorem 3 in the paper A Universal Law of Robustness via isoperimetry by Bubeck and Sellke. Basically, there exist at least one $w_{L,e}$ in $\mathcal{W}_{L,e}$ ...
user avatar
  • 101
0 votes
0 answers
18 views

Why does triplet loss allow to learn a ranking whereas contrastive loss only allows to learn similarity?

I am looking at this lecture, which states (link to exact time): What the triplet loss allows us in contrast to the contrastive loss is that we can learn a ranking. So it's not only about similarity, ...
user avatar
  • 669
0 votes
0 answers
28 views

What is the correct formula for the loss function?

I have used the Delayed sin echo prediction with Tensorflow that predicts the sin wave. However, I'm not sure of the correct formula for the loss function. The problem is that I feed the training ...
user avatar
0 votes
0 answers
28 views

How to use a Siamese network at test time?

I am trying to understand Siamese networks, and understand how to train them. Once I have a trained network, I want to know if a new image is close or far to other images in the train set, and fail to ...
user avatar
  • 669
1 vote
1 answer
38 views

How contrastive loss work intuitively in siamese network

I am having issue in getting clear concept of contrastive loss used in siamese network. Here is pytorch formula ...
user avatar
0 votes
1 answer
40 views

Does this modified version of the triplet loss function introduced with SBERT that uses the cosine similarity make sense?

I am working on a modified version of the triplet loss function introduced with SBERT, where instead of the Euclidean distance we use the cosine similarity. The formula to minimize is ...
user avatar
  • 103
1 vote
0 answers
126 views

How to compute circle loss?

I have read the paper about circle loss for neural networks. I may have missed something, but I didn't find the way to compute the positive similarity and the negative similarity in the case of circle ...
user avatar
0 votes
1 answer
103 views

Does Value Loss in Actor Critic not decrease at all?

I am coding a problem with the Actor-Critic Method. The final loss is a summation of PolicyLoss and ValueLoss. The calculation of the PolicyLoss for each step is given at Equation Number 5 of https://...
user avatar
0 votes
0 answers
352 views

Focal Loss vs Weighted Cross Entropy Loss

Weighted Focal Loss is defined like so $FL(p_t) = -\alpha_t log(p_t) (1-p_t)^\gamma $ Whereas weighted Cross Entropy Loss is defined like so $CE(p_t) = -\alpha_t log(p_t)$ Some blog posts try to ...
user avatar
  • 669
0 votes
0 answers
17 views

What should I need to ultimately focus, on considering the fact that convex losses are confirmed to be converged?

Consider the following excerpt from the topic named Understanding the error function from the textbook titled Deep Learning with PyTorch by Eli Stevens et al saying about the advantages of using ...
user avatar
  • 3,099
0 votes
1 answer
121 views

Is learning rate the only reason for training loss oscillation after few epochs?

Consider the following loss curve The x-axis is the no. of epochs and the y-axis is the loss function. You can observe that loss is decreasing drastically for the first few epochs and then starts ...
user avatar
  • 3,099
1 vote
0 answers
29 views

How to compute the loss for a sequence labeling task without the Softmax distribution?

For a sequence labeling task (NER), we compute the loss by passing the softmax distribution of the classes (e.g. vocabulary) with the gold label to the loss function (...
user avatar
  • 123
0 votes
0 answers
15 views

XLMRoberta loss remains constant over iterations for TokenClassification task

I have created a simple XLMRoberta model for token classification. The task is to predict the quality of translation for each token/word. The data looks something like this, where the first sentence ...
user avatar
1 vote
1 answer
21 views

Writing a loss function for "how far can this output be pushed"

I'm trying to train a function for a industrial-process-control-like system. This is my first attempt at a custom training, so feel free to point out any invalid assumptions. I've got one input and ...
user avatar
  • 111
0 votes
0 answers
135 views

ignoring instances or masking by zero in multitask learning model

For a multitask learning model, I've seen that approaches usually mask the output that doesn't have a label with zeros. As an example, have a look here: How to Multi-task learning with missing labels ...
user avatar
  • 123
0 votes
0 answers
24 views

Proper loss function for regression with uniform target distribution

I'm doing some simulations and I would like to estimate a real number that is uniformly distributed between minValue and maxValue...
user avatar
  • 101
1 vote
1 answer
69 views

What is the name of this letter $\mathcal{J}$?

What is the name of this letter $\mathcal{J}$ in the following deep learning equation? And what alphabet it is from? $$\mathcal{J} = \frac{1}{m} \sum_{i=1}^m \mathcal{L}^{(i)}$$
user avatar
2 votes
1 answer
132 views

How to handle invalid actions for next state in Q-learning loss

I am implementing an RL application in an environment with illegal moves. For handling the illegal moves, I am currently just picking an action as the maximum Q-value from the set of legal Q-values. ...
user avatar
0 votes
0 answers
24 views

Do I need to imagine loss curves of changing shapes in case of GANs?

Loss function, in general, is imagined as a curve in higher dimensional space with weights on input axes and loss on output axes. Suppose we have a neural network and we are training our neural ...
user avatar
  • 3,099
0 votes
1 answer
193 views

KL divergence coefficient update doesn't make sense in RLlib's PPO implementation

I am using RLlib (Ray 1.4.0)'s implementation of PPO for a multi-agent scenario with continuous actions, and I find that the loss includes the KL divergence penalty term, apart from the surrogate loss,...
user avatar
  • 223
2 votes
0 answers
356 views

How to interpret the training loss curves in Soft-Actor-Critic (SAC)?

I am using stable-baseline3 implementation of the Soft-Actor-Critic (SAC) algorithm. The plotted training curves look promising. However, I am not fully sure how to interpret the actor and critic ...
user avatar
  • 35
2 votes
3 answers
260 views

Where does the so-called 'loss' / 'loss function' fit into the idea of a perceptron / artificial neuron (as presented in the figure)?

I am currently studying the textbook Neural Networks and Deep Learning by Charu C. Aggarwal. Chapter 1.2.1.3 Choice of Activation and Loss Functions presents the following figure: $\overline{X}$ is ...
user avatar
1 vote
0 answers
50 views

Could the inputs of the mean squared-error loss function be transformed to allow larger learning rates?

In the context of a neural network $\hat{y} = f_\theta(\mathbf{x})$ with parameters $\theta$ that is trained to perform regression such that the prediction $\hat{\mathbf{y}} = [\hat{y}_1,\hat{y}_2,...,...
user avatar
  • 223
1 vote
0 answers
22 views

How does the loss landscape look like or change when a model is overfitting?

My understanding is that when a model starts overfitting, it no longer learns useful features and starts remembering the training data set. Given enough epochs and sufficient parameters, a model can ...
user avatar
0 votes
1 answer
65 views

Is it okay to calculate the validation loss over batches instead of the whole validation set for speed purposes?

I have about 2000 items in my validation set, would it be reasonable to calculate the loss/error after each epoch on just a subset instead of the whole set, if calculating the whole dataset is very ...
user avatar
1 vote
1 answer
117 views

Why do the training and validation loss curves diverge?

I was training a CNN model on TensorFlow. After a while I came back and saw this loss curve: The green curve is training loss and the gray one is validation loss. I know that before epoch 394 the ...
user avatar
2 votes
1 answer
53 views

What is the "contradictory loss" in the "Old Photo Restoration via Deep Latent Space Translation" paper?

In page 4 of the paper Old Photo Restoration via Deep Latent Space Translation, it says the encoder $E_{R,X}$ of $VAE_1$ tries to fool the discriminator with a contradictory loss to ensure that $R$ ...
user avatar
  • 21
1 vote
0 answers
65 views

WGAN-GP Loss formalization

I have to write the formalization of the loss function of my network, built following the WGAN-GP model. The discriminator takes 3 consecutive images as input (such as 3 consecutive frames of a video) ...
user avatar
  • 11
1 vote
1 answer
98 views

Why does the accuracy drop while the loss decrease, as the number of epochs increases?

I've been trying to find the optimal number of epochs that I should train my neural network (that I just implemented) for. The visualizations below show the neural network being run with a variable ...
user avatar
  • 11
0 votes
0 answers
25 views

Loss function for better class separability in multi class classification

So I am trying to enforce better separability in my deep learning model and was wondering what I can use besides cross entropy loss to do that? Could maybe using logarithm with different basis in ...
user avatar
  • 101
0 votes
0 answers
66 views

Variance of the Gaussian policy is not decreasing while training the agent using Soft Actor-Critic method

I've written my own version of SAC(v2) for a problem with continuous action space. While training, the losses for the value network and both q functions steadily decrease down to 0.02-0.03. The loss ...
user avatar
1 vote
0 answers
44 views

Why does loss and accuracy for a multi label classification ann does not change overtime?

I have run into a strange behavior of my multi label classification ANN ...
user avatar
2 votes
1 answer
228 views

Why L2 loss is more commonly used in Neural Networks than other loss functions?

Why L2 loss is more commonly used in Neural Networks than other loss functions? What is the reason to L2 being a default choice in Neural Networks?
user avatar
1 vote
0 answers
206 views

LSTM - MAPE Loss Function gives Better Results when Data is De-Scaled before Loss Calculation

I am building an LSTM for predicting a price chart. MAPE resulted in the best loss function compared to ...
user avatar
1 vote
0 answers
273 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 ...
user avatar
  • 151
2 votes
1 answer
122 views

Do smaller loss values during DQN training produce better policies?

During the training of DQN, I noticed that the model with prioritized experience replay (PER) had a smaller loss in general compared to a DQN without PER. The mean squared loss was an order of ...
user avatar
  • 1,211
1 vote
0 answers
62 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 ...
user avatar
  • 23
2 votes
1 answer
48 views

Data scan not making sense for coco dataset

I am doing a simple scan to see how dataset size affects training. Basically, I took 10% of the coco dataset and trained a yolov3 net (from scratch) to just look for people. Then I took 20% of the ...
user avatar
2 votes
0 answers
27 views

Why is the loss of one of the outputs of a model with multiple outputs increasing while the others are decreasing?

I'm a newbie in neural networks. I'm trying to fit my neural network that has 3 different outputs: semantic segmentation, box mask and box coordinates. When my model is training, the loss of ...
user avatar
1 vote
0 answers
32 views

Crossing of training and validation loss

During training of my models I often encounter the following situation about training (green) and validation (gray) loss: Initially, the validation loss is significantly lower than the training loss. ...
user avatar
  • 166
1 vote
0 answers
40 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 ...
user avatar
  • 111