Questions tagged [loss]
For questions related to the concept of loss (or cost) in machine learning or other AI sub-fields.
86
questions
1
vote
1
answer
201
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
...
0
votes
1
answer
192
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 ...
2
votes
0
answers
389
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 ...
1
vote
1
answer
959
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://...
0
votes
0
answers
2k
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 ...
0
votes
1
answer
2k
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 ...
1
vote
0
answers
168
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 (...
1
vote
1
answer
28
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 ...
1
vote
1
answer
149
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)}$$
2
votes
1
answer
533
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.
...
0
votes
2
answers
867
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,...
3
votes
0
answers
2k
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 ...
2
votes
3
answers
459
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 ...
1
vote
0
answers
86
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,...,...
1
vote
0
answers
51
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 ...
0
votes
1
answer
316
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 ...
1
vote
2
answers
738
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 ...
2
votes
1
answer
66
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$ ...
1
vote
0
answers
183
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) ...
1
vote
1
answer
463
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 ...
0
votes
0
answers
37
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 ...
0
votes
0
answers
142
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 ...
1
vote
0
answers
53
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
...
2
votes
1
answer
861
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?
1
vote
0
answers
364
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 ...
1
vote
0
answers
389
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 ...
2
votes
1
answer
156
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 ...
1
vote
0
answers
145
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 ...
2
votes
1
answer
64
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 ...
2
votes
0
answers
44
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 ...
1
vote
0
answers
42
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. ...
1
vote
0
answers
43
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 ...
1
vote
1
answer
148
views
How to explain peak in training history of a convolutional neural network?
I am training a simple convolutional neural network to recognize two types of 1024-point frequency spectra (FFT). This is the model I'm using:
...
1
vote
1
answer
194
views
How to plot Loss Landscape with more than 2 weights in the network
For a single neuron with 2 weights, I can plot the loss landscape and it looks like this (OR data, sigmoid activation, MAE loss):
But, when the neuron accepts more inputs, which means more than 2 ...
10
votes
3
answers
4k
views
Should I choose a model with the smallest loss or highest accuracy?
I have two Machine Learning models (I use LSTM) that have a different result on the validation set (~100 samples data):
Model A: Accuracy: ~91%, Loss: ~0.01
Model B: Accuracy: ~83%, Loss: ~0.003
The ...
2
votes
1
answer
175
views
How to perform back-propagation in Decoupled Neural Interfaces?
I am attempting to create a fully decoupled feed-forward neural network by using decoupled neural interfaces (DNIs) as explained in the paper Decoupled Neural Interfaces using Synthetic Gradients (...