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
1 vote
1 answer
18 views

How does DistilBERT's training ensure that the [CLS] token's hidden state from DistilBERT aligns with that from BERT?

BERT's pre-training involves next sentence prediction (NSP) based on a classifier on top of the [CLS] token's last hidden state. This is primarily what gives the [CLS] token's hidden state the special ...
Fijoy Vadakkumpadan's user avatar
1 vote
1 answer
31 views

Are these objective and loss functions from Actor-Critic Methods correct?

I'm doing a research about actor-critic methods and I want to make sure that I understand these methods right. First of all, I understand that as it's a combination of value-based and policy-based ...
marc_spector's user avatar
0 votes
0 answers
23 views

How is $(p,v)$ used to calculate loss in the AlphaZero algorithm?

I'm trying to implement the AlphaZero algorithm. AlphaZero uses a neural network $f_{\theta}$ with parameters $\theta$ for board state $s$. It returns $(p,v)$, where $p$ is a vector of move ...
Void Break's user avatar
0 votes
1 answer
20 views

global minimum loss always best metric?

Suppose the hardware constraint is not a problem anymore, so that the quantum computer is everywhere. If we define a neural network model that has many params, traditionally (using gradient descent) ...
Muhammad Ikhwan Perwira's user avatar
2 votes
1 answer
26 views

Do we plug in the old values or the new values during the gradient descent update?

I have a scenario when I am trying to optimize a vector of D dimensions. Every component of the vector is dependent on other components according to a function such as: summation over (i,j): (1-e(x_i)(...
Darkmoon Chief's user avatar
0 votes
0 answers
46 views

Early divergence of YOLOv7-tiny train and val obj_loss plots

I am training a YOLOv7-tiny model and have the following observations from the training session: the train and val objectness loss plots diverged pretty early on in the training process the class and ...
fuse use's user avatar
0 votes
1 answer
51 views

Low validation loss from the first epoch?

The initial validation loss is low from the first epoch and then decreases slightly. What does this actually mean? Does it indicate that the model can effectively and quickly identify patterns for ...
RT.'s user avatar
  • 101
0 votes
0 answers
82 views

How is this z-loss implementation in t5x related to this paper's loss X?

I was looking into the loss function in t5x here and see there is a z-loss added to the typical log loss definition. The only paper I could surface on this was https://arxiv.org/abs/1604.08859, but I ...
Jacob B's user avatar
  • 267
0 votes
0 answers
59 views

why YOLO models multiple the loss by batch size in detection head?

here return loss.sum() * batch_size, loss.detach() # loss(box, cls, dfl) This line is from yolov8, but I saw similar thing in v5 too. So far I only see this kind ...
Wang's user avatar
  • 101
0 votes
0 answers
91 views

No matter how I change a loss function I get it equal to infinity

I am a bioinformatician, and at the moment I am working with a dataset containing ~12.3 million mutations for ~5500 individuals. The goal is to perform binary classification. I use this framework to ...
YKY's user avatar
  • 101
0 votes
1 answer
28 views

Understanding different methods of covariance parametrization

In the paper https://arxiv.org/pdf/2112.02143 it is noted that there are different ways to "parametrize" covariance. (page 4) What does "parametrizing" covariance mean exactly? In ...
Homer Sanchez's user avatar
0 votes
0 answers
14 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
26 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
62 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
28 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
17 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
64 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
  • 153
0 votes
0 answers
327 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
90 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
  • 53
1 vote
1 answer
102 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
47 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
94 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
  • 83
1 vote
1 answer
138 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
33 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
  • 303
0 votes
1 answer
90 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
2 votes
1 answer
295 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
824 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
2 votes
0 answers
169 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
23 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
854 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
4 votes
0 answers
449 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
  • 281
0 votes
3 answers
700 views

What is loss function in Neural Networks?

I've been studying NNs with tensorflow and decided to code a simple NN from scratch to get a better idea on hwo they work. It my understanding that the cost is used in backpropagation, so basically ...
user20170158's user avatar
0 votes
1 answer
597 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
1 vote
1 answer
183 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
  • 167
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
106 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
382 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
121 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
  • 167
1 vote
0 answers
110 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
108 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
78 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,280
1 vote
1 answer
76 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
  • 195
0 votes
1 answer
107 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
  • 113
0 votes
1 answer
175 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
133 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
52 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
270 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
28 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
106 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
  • 119