Skip to main content

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
12 views

weighted multi class classification

i'm working on a multi class classification problem which classifies jellyfish and plastic pollution so basically i have 6 classes (barrel_jellyfish, compass_jellyfish, lions_mane_jellyfish, ...
Gabovix's user avatar
0 votes
1 answer
21 views

Loss goes down but never below a certain treshold

I made a neural network in C#, I observe the loss goes down but never below a certain treshold. This is XOR function error graph: (The graph is every 4 samples, so for all the 4 possible combinations ...
CoffeDeveloper's user avatar
0 votes
0 answers
31 views

StyleGAN 2 multiplies loss components with zero, why?

I found a rather odd piece of code in a 3.8k star repo of the well known StyleGAN 2 paper. In the loss function they use the following expression: ...
Klops's user avatar
  • 111
0 votes
0 answers
11 views

Solving an ODE with factors that span over orders of magnitude in the region of interest with PINN

I am trying to solve the following ordinary differential equation (ODE) with a physics informed neural network (PINN) $$ \frac{dZ}{dx} = A(x) (1-Z^2) \exp(-Z) - B(x) $$ where A(x) function varies in ...
Maxim's user avatar
  • 1
0 votes
0 answers
13 views

Is sparse categorical crossentropy support arbitrary custom label encoding?

As we know that in AI tools like tensorflow has loss named sparse_categorical_crossentropy which bassically ...
Muhammad Ikhwan Perwira's user avatar
0 votes
0 answers
61 views

How and whether to apply Reinforcement Learning in an Environment with a precise and always available Evaluation?

Say we want to train an agent $A$ in an environment $E$ which provides a continuous loss $L$. That is, we want $A$ to choose its actions $a$ so that it minimizes the mistake it does, i.e., it ...
Mathy's user avatar
  • 143
0 votes
0 answers
177 views

Why is there a "reference free" option in DPO (Direct Preference Optimization)'s loss function?

There is a reference_free parameter in trl's loss function implementation of DPO, while the original DPO paper does not mention the concept of "reference free". In trl's implementation: <...
Yang Bo's user avatar
  • 51
3 votes
1 answer
70 views

Regression loss conditioned by the ground-truth values

I'm working on a regression problem with a CNN in which the input is a single image, and the output is an angle in degrees (which determines a specific measure related to the image). Sometimes, the ...
Cezoz08's user avatar
  • 43
0 votes
0 answers
29 views

Has There Been Research on Using a Neural Network as a Loss Function for Another Neural Network?

I'm intrigued by the idea of employing a separate neural network (which I'll refer to as the "loss network") to compute the loss for a primary network based on its inputs and outputs. The ...
Deadbeef Development's user avatar
0 votes
0 answers
175 views

Unable to interpret DDPG actor-critic loss curves

I am training a DDPG actor-critic agent and ploting rewards and loss curves each episode to track the training evolution. Rewards values in the plot correspond to the total reward per episode divided ...
davipeix's user avatar
0 votes
0 answers
21 views

How (or can) you formulate the Fisher information matrix in terms of a loss function, specifically cross-entropy loss?

I recently saw the following formulation of the Fisher information matrix in a paper on Transformer pruning: $$ \mathcal{I} := \frac{1}{|D|} \sum_{(x,y) \in D} \left( \frac{\partial \mathcal{L}(x,y;1)}...
premed's user avatar
  • 1
1 vote
1 answer
77 views

What is the lowest possible loss for a language model?

Example: Suppose a character-level language model (three input letters to predict the next one), trained on a dataset which contains three instances of the sequence ...
ViniciusArruda's user avatar
0 votes
1 answer
34 views

Multiple Loss Functions For Proper Parameter Updates [closed]

I am working on a model on PyTorch where it has two loss functions each fed from two separate input datasets. I want to update the model parameters based on these loss functions, ic_loss, res_loss, ...
Burak Karaosmanoğlu's user avatar
0 votes
0 answers
52 views

Why does my loss function fluctuate so much?

I have a loss function that I'm trying to maximise using a neural network. While it does appear to increase and plateau over the training, it does so in a very "noisy" manner, spiking up and ...
VJ123's user avatar
  • 73
1 vote
1 answer
101 views

How to transform a loss function into a score function?

Loss_Function/Maximize_Function/Score_Function, CustomLoss, pytorch. Using Custom Loss for Maximizing Score in PyTorch I'm using a PyTorch model with an LSTM input layer, a linear hidden layer, and 3 ...
IAQuestions's user avatar
0 votes
1 answer
30 views

What are the differences between loss surfaces that "derive"from different observations?

If I understand right that each observation whithin a dataset, creates a different loss surface where we want to find the global minimum. How different those surfaces one from another? Would it be ...
Igor's user avatar
  • 181
0 votes
1 answer
72 views

Simple reinforcement learning with human feedback to generate "pleasurable" visual output

I'm trying to build a simple reinforcement learning model that will output a set of parameters that will be passed to a GLSL shader. The human user will rate this visual output, for example "good&...
fiatmoney's user avatar
0 votes
0 answers
39 views

Loss is negative- DQN with BCE Loss function

I am writing a code with DQN, using BCE as a loss function for the classification of a sequential time series. But while training, the loss value goes in negative. Also, accuracy and binary accuracy ...
rainarashika's user avatar
1 vote
1 answer
146 views

Fluctuations in loss during in epoch evaluation of GRU

I am training a one-layer unidirectional vanilla GRU on a next item prediction task with regard to the last 10 interacted items. In my original experiment, where I trained on approx. 5.5M samples and ...
PatrickSVM's user avatar
3 votes
1 answer
673 views

Has anyone tried to train a GPT model predicting the next N tokens instead of the next one token?

I have been thinking about how learning via text works on humans: we read words, and often we need to read ahead a few words to understand more clearly the ideas that we read before. Most of the time, ...
bruno's user avatar
  • 33
1 vote
0 answers
96 views

Periodical fluctuations in loss curves

I am training a neural network (specifically a GRU based architecture but I think this is not too relevant for the question). My loss curves, especially the training loss but also the validation loss, ...
PatrickSVM's user avatar
1 vote
0 answers
21 views

Why is my loss graph heavily fluctatuing?

I am working on a CNN project on an image dataset. I am applying Early Stopping technique in order to train the model. However, after training the model and obtaining the loss graph, it is heavily ...
Zelreedy's user avatar
2 votes
2 answers
498 views

Does MSE loss function work in NN training for predicting values between 0-1?

In a NN regression problem, considering that MSE is squaring the error and the error is between 0 and 1 would it be pointless to use MSE as our loss function during model training? For example: ...
Darren Rahnemoon's user avatar
0 votes
0 answers
193 views

What's wrong with our loss and PyTorch?

Given the samples $\vec{x_i} \in \mathbb{R}^d, i \in [1,..,l]$ where $l$ is the number of training samples, $d$ is the number of input features, the related target values $y_i \in \mathbb{R}$, and the ...
Filippo Portera's user avatar
3 votes
0 answers
380 views

GAN : Why does a perfect discriminator mean no gradient for the generator?

In the training of a Generative Adversarial Networks (GAN) system, a perfect discriminator (D) is one which outputs 1 ("true image") for all images of the training dataset and 0 ("false ...
Soltius's user avatar
  • 271
0 votes
1 answer
399 views

Multilabel text classification with highly imbalanced training data

I'm trying to train a multilabel text classification model using BERT. Each piece of text can belong to 0 or more of a total of 485 classes. My model consists of a dropout layer and a linear layer ...
Fijoy Vadakkumpadan's user avatar
0 votes
1 answer
102 views

Training and validation loss are almost the same (perfect fit?)

I am developing an ANN from scratch which classifies MNIST digits. These are the curves I get using only one hidden layer composed of 100 neurons activated by ...
tail's user avatar
  • 157
2 votes
2 answers
3k views

Val loss doesn’t decrease after a certain number of epochs

I’m working on a classification problem (500 classes). My NN has 3 fully connected layers, followed by an LSTM layer. I use nn.CrossEntropyLoss() as my loss ...
helloworld's user avatar
0 votes
1 answer
104 views

Why is `SigmoidBinaryCrossEntropyLoss` in `DJL` implemented this way?

SigmoidBinaryCrossEntropyLoss implementation in DJL accepts two kinds of outputs from NNs: where sigmoid activation has already been applied. where raw NN output ...
src091's user avatar
  • 1
0 votes
1 answer
250 views

What does the adversarial loss in a GAN represent?

I'm working on Pix2Pix an image-to-image translation GAN, and I noticed that there is an adversarial loss implemented using BCE, and a L1 loss implemented using MAE. I know L1 loss represents the ...
CoderMath's user avatar
0 votes
1 answer
77 views

Training loss decreases very fast after few epochs

I am implementing an ANN whose training loss is in Figure: As you can see training loss decreases very fast and it is approximately 3.2 at epochs 2, 3, ..., 8, ... 10, and so on. (batch learning) The ...
tail's user avatar
  • 157
1 vote
0 answers
75 views

Training a neural network simultaneously with two different loss functions rather than considering the weighted sum

This is a follow up on the already asked question: Is the neural network 100% accurate on training data if epoch loss is minimized to 0? I want to train a neural network that works as an approximator ...
Acad's user avatar
  • 111
0 votes
1 answer
94 views

How to use Categorical Cross Entropy for Multi-Label Classification?

Say my target with classes A, B, C, D, E is [0, 1, 1, 0, 0]. And my output layer is of B x N where N is the number of classes. ...
bluewander's user avatar
1 vote
1 answer
68 views

What loss function will be correlated with classification metrics?

Recently I developed a custom training algorithm for deep learning models, based on evolutionary algorithms. Details are not important, except that it also uses decreasing regular cross entropy loss ...
GKozinski's user avatar
  • 1,260
1 vote
1 answer
62 views

Do we need to know or verify properties of loss functions / metrics' implementations?

I will start with an example, in order to get to the general question. I was reading the following paper (https://www.cns.nyu.edu/pub/lcv/wang03-preprint.pdf) about Structural Similarity Index (SSIM), ...
Theo Deep's user avatar
  • 185
0 votes
1 answer
82 views

Can MSE be used for NN categorical classification problems

I currently have a neural network that can manage to perform polynomial (single output) regression problems. I now want to upscale to classification problems (eg: image recognition). Can I do this ...
Gamaray's user avatar
  • 13
0 votes
1 answer
145 views

Non-Convex loss-surface although quadratic loss function

there is one problem which bugs me quite a long time, it is the non-convex loss shape (multiple minima, e.g. shown here) of neural networks which use a quadratic loss function. Question: Why is a “...
horsti's user avatar
  • 3
1 vote
0 answers
97 views

How to detect peak locations via Neural Networks?

As part of my masters thesis, I'm developing generative models for ECGs. Right now, I have a Denoising Diffusion Implicit model (DDIM), that transforms random noise into a valid ECG (2s long, or 1024 ...
Jackilion's user avatar
1 vote
1 answer
48 views

How do I interpret this loss function?

In this AI note from https://deeplearning.ai, the loss function below is used for a regression problem. However, I don't know how to interpret this loss function. First, does the author take the ...
Zarif's user avatar
  • 113
1 vote
0 answers
266 views

Categorical loss function for variable number of labels

I have a model for binary classification. The target variable has the different number of labels (instances) in each sample. For example, a batch of size 2 with 2 and 3 instances and correspondingly ...
Mykola Zotko's user avatar
0 votes
1 answer
27 views

"Tweaking" the cost function to penalize rarer cases more severely

I have a very unbalanced data set that I am running a CNN on for regression. Most of the values are 0, while it is possible for the values to range from 0 to 32. Is it possible to "tweak" ...
Paul Reiners's user avatar
0 votes
0 answers
90 views

uniform gap between training and validation metrics

I am training a neural network (Deep and cross network) for a multi-label classification task (~700 labels). I have around 2.5 million samples, splitted 8/1/1 for train/test/validation. I am seeing a ...
Ryan's user avatar
  • 121
2 votes
2 answers
303 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: ...
Foobar's user avatar
  • 153
2 votes
1 answer
950 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 ...
Gabriel Mongaras's user avatar
1 vote
1 answer
104 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 ...
Blade's user avatar
  • 151
0 votes
2 answers
68 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 ...
Ryan's user avatar
  • 3
1 vote
2 answers
358 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 ...
Lukas Pezzei's user avatar
1 vote
1 answer
950 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: ...
Antonis Karvelas's user avatar
2 votes
2 answers
970 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, ...
Gulzar's user avatar
  • 759
0 votes
0 answers
36 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 ...
I_Al-thamary's user avatar