Questions tagged [objective-functions]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
21 views

Multi-task objective sometimes improve single-task performance, but is this true when fine tuning?

It is known that multitask objectives in neural networks sometimes have the effect of improving the performance of the neural network for each of the tasks individually (versus training the same ...
Alexander Soare's user avatar
2 votes
2 answers
37 views

Why does an action cost function dependes on result state in search problems?

In the famous AI book Artificial Intelligence: A Modern Approach by Stuart Russell and Peter Norvig (4th edition), in chapter 3, the action cost function of a problem solver agent denoted as $c(s, a, ...
user153245's user avatar
2 votes
1 answer
60 views

Can you explain the Hinton's comment "Rprop is equivalent to using the gradient, but also dividing by the size of the gradient"?

Been reviewing some old foundational material and ran into this comment by Hinton on Rprop in his old Coursera class: Rprop is equivalent to using the gradient, but also dividing by the size of the ...
eof's user avatar
  • 121
0 votes
0 answers
30 views

Non differentiable loss function train with actor critic style

I'm working on a project where a non differentiable loss is there. I'm thinking about how should I deal with them. My model is a very big lstm model (about 1M parameter), and after 500 steps (not sure ...
TWTom's user avatar
  • 13
0 votes
0 answers
151 views

What is the loss function used when pre-training BERT on MLM & NSP tasks?

I'm new to NLP and was reading through the 2019 BERT paper and am confused about the loss function used during pre-training. As I understand it, the model is trained on the MLM and NSP tasks. The MLM ...
Karla's user avatar
  • 1
0 votes
0 answers
27 views

What Kind of Models and Loss Functions for User Churn Prevention by Promo Codes?

The Company Business Model Bike rental with an app, where riders pay for the time they rented the bikes for. The Business Case User (rider) attrition prediction, and ideally, prevention. Basically, ...
Della's user avatar
  • 111
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
1 vote
0 answers
32 views

How do LGBM rankers train?

I'm looking into Learning to Rank models - specifically, the LGBMRanker model - and I want to understand how it's able to train. It takes in features, group sizes and labels, and optimizes for a ...
Shirish Kulhari's user avatar
1 vote
0 answers
23 views

Search recall optimization - what appropriate loss function to use?

I am studying machine learning and wanted to work on a project of my own so that I have better chances after graduating college. I'm studying the application of ML to improve searches using a toy ...
user9343456's user avatar
1 vote
1 answer
52 views

why learn an observation model when training latent space model in model based rl

I'm currently studying reinforcement learning through CS 285 provided by UC Berkeley. At 1:52 of the part 5 of the lecture 11, I got confused on why one would want to learn an observation model $p(o_t ...
platoDev's user avatar
0 votes
0 answers
25 views

How to check clustering performance?

Background I'm implementing the DBScan algorithm. I have trained it to cluster a small dataset of random clusters, and want to be able to get a decimal for its accuracy of clustering the groups. ...
SamTheProgrammer's user avatar
0 votes
1 answer
90 views

In logistic regression, do I try to fit the graph perfectly or mimimize the error in the predicted probabilities?

In linear regression, I train the model so the graph runs best through the data points, so the geometric distance between f(x) and $y^i$ is minimized. Now, is it correct that in logistic regression I ...
Jacky02's user avatar
0 votes
0 answers
40 views

How to calculate CIoU or DIoU loss only for certain unmasked boxes in tensor and ignore the masked values?

...
Amish Agrawal's user avatar
1 vote
0 answers
38 views

Can gradient descent cause loss to increase in some situations?

Is a gradient descent step always supposed to decrease loss? I can think of a situation where it would seem that gradient descent would increase loss but maybe it I am misunderstanding a part of ...
Mike Levi's user avatar
1 vote
2 answers
43 views

How do I assign a weight to an additional loss?

I am trying to do multi-spectral image fusion. I am using the following paper as a reference. https://arxiv.org/pdf/1804.08361.pdf The code available on GitHub works well. But, I am trying to add some ...
programmer_04_03's user avatar
1 vote
0 answers
567 views

What is MLM & NSP loss function

Two objective functions are used during the BERT language model pretraining step. The first one is masked language model (MLM) that randomly masks 15% of the input tokens and the objective is to ...
XYZ's user avatar
  • 121
4 votes
1 answer
329 views

What is the best way to combine or weight multiple losses with gradient descent?

I am optimizing a neural network with Adam using 3 different losses. Their scale is very different, and the current method is to either sum the losses and clip the gradient or to manually weight them ...
Simon's user avatar
  • 153
0 votes
1 answer
29 views

Which loss / activation function with 2 classes that do not occur often and do not sum to one?

I have a neural network that predicts 2 classes of a time series (bottom and top). Currenlty my Y labels are size 2: [1 0] for bottom and [0 1] for top. The NN has 2 output nodes. Of course not every ...
dorien's user avatar
  • 216
0 votes
1 answer
312 views

What is the correct loss function for binary classification: Cross entropy or Binary cross entropy?

Let's say I have a binary classification problem and I want to solve it by means of FC neural net. So which approach will be correct: 1) define the last layer of NN like this ...
dmasny's user avatar
  • 23
0 votes
1 answer
3k views

What's the difference between classification and segmentation in deep learning?

What's the difference between classification and segmentation in deep learning? In particular, can the classification loss function be used for segmentation problems?
lllittleX's user avatar
2 votes
1 answer
126 views

Image classification problem with multiple right classes

I have a use case where the model needs to detect fabricdefects. There are 15+ different kinds of defects. In one image there can be multiple defects present. The straight forward solution for this ...
Nick De Wispelaere's user avatar
1 vote
1 answer
484 views

Why MSE and MAE yield poor results when used with gradient-based optimization for classification?

Deep learning book chapter 6: In 6.2.1.2 last paragraph: Unfortunately, mean squared error and mean absolute error often lead to poor results when used with gradient-based optimization. Some output ...
vivian.ai'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
1 vote
0 answers
35 views

Loss Function for Binary Classification with Multiple Correct Choices

I have a binary classification problem, where there are multiple correct predictions, however, I would consider the prediction to be correct if the highest confidence prediction of a 1 is correct. I ...
John Meighan's user avatar
0 votes
1 answer
47 views

Learning curve converges with huge errors

I am training an auto-encoder over $10^4$ epochs. I get a converging learning curve. However the error at the last stages stays huge $\sim10^{15}$. What does this mean? does it mean that my auto-...
devCharaf's user avatar
  • 101
1 vote
0 answers
73 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
1 vote
0 answers
341 views

Left-to-Right vs Encoder-decoder Models

Xu et al. (2022) distinguishes between popular pre-training methods for language modeling: (see Section 2.1 PRETRAINING METHODS) Left-to-Right: Auto-regressive, Left-to-right models, predict the ...
keyboardAnt's user avatar
1 vote
1 answer
57 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
163 views

Is the discriminator of a GAN network embedded in VAE?

From what I understand, a Generative Adversarial Network (GAN) is composed of an encoder (generator), some synthetic data (fake data) and a discriminator that will penalize any distinguishable real ...
Rhesus's user avatar
  • 3
3 votes
1 answer
214 views

What loss function should I use if I only care about the accuracy of one class?

CrossEntropyLoss optimizes the overall classification accuracy as $$ {n_{\text{correct}} \over N} $$ What loss function should I use if I only care about increasing the true positive rate of one class?...
em1971's user avatar
  • 155
0 votes
2 answers
70 views

How to define a loss function for multi-label problem?

I have voice recordings which are labelled by not only a single label but multiple labels. Each voice recording corresponds to one of class labels within a set. In other words, the training instance ...
MilTom's user avatar
  • 113
9 votes
1 answer
7k views

What is the difference between the triplet loss and the contrastive loss?

What is the difference between the triplet loss and the contrastive loss? They look same to me. I don't understand the nuances between the two. I have the following queries: When to use what? What ...
Exploring's user avatar
  • 343
1 vote
2 answers
796 views

What should I think about when designing a custom loss function?

I'm trying to get my toy network to learn a sine wave. I output (via tanh) a number between -1 and 1, and I want the network to minimise the following loss, where ...
cjm2671's user avatar
  • 113
1 vote
2 answers
342 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
2 votes
0 answers
30 views

How to create a loss function that penalizes duplicate indices in the output tensor?

We're working on a sequence-to-sequence problem using pytorch, and are using cross-entropy to calculate the loss when comparing the output sequence to the target sequence. This works fine and ...
vgoklani's user avatar
  • 121
3 votes
1 answer
260 views

Why do we use "true labels" that are based on the output of our network in Deep Q-Learning?

In the original DQN paper, the $\ell_2$ loss is taken over the distance between our network output, $\hat{q}(s_j,a_j,w)$ and the labels $y_j=r_j+\gamma \cdot \max\limits_{a'} \hat{q}(s_{j+1},a',w^-)$, ...
Hadar Sharvit's user avatar
1 vote
0 answers
41 views

Learning values in open ball: which final layers to employ?

I'm fairly new to deep learning and looking for some reference literature... Specifically, I want to train a neural network to predict vectors $v \in \mathbb{R}^3$ under the constraint $||v||\leq 1$. ...
Lilla's user avatar
  • 111
0 votes
1 answer
82 views

How is catastrophic cancellation dealt with in loss functions?

It just occurred to me that this seems like it should be a very common problem that must have some kind of solution... Yet I'm not sure what it is... If there is no solution, does this mean once a ...
profPlum's user avatar
  • 424
0 votes
0 answers
71 views

how to define or calculate the similarity betweeen two curves as the loss funtion to optimize in the generative model?

I want to train a neural network as the curve productor that can generate the specific type of curves (e.g. exponential decay curves). I take the encoder-decoder structure, the curves in a dataset is ...
minghuisvn's user avatar
2 votes
1 answer
1k views

What is the reason we loop over epochs when training a neural network?

After reading through this thread and some other resources online, I still do not understand the role of epochs in training a neural network. I understand that one epoch is one iteration through the ...
tanasr's user avatar
  • 82
7 votes
2 answers
8k views

What is the difference between a loss function and reward/penalty in Deep Reinforcement Learning?

In Deep Reinforcement Learning (DRL) I am having difficulties in understanding the difference between a Loss function, a reward/penalty and the integration of both in DRL. Loss function: Given an ...
Theo Deep's user avatar
  • 185
0 votes
0 answers
142 views

In CVAE's objective function, why do both terms condition on $\textbf{c}$?

I don't quite understand why, in Conditional Variational Autoencoder (CVAE), we concatenate a conditioning vector two times, at encoder and decoder respectively. After we concatenate it once at the ...
James Arten's user avatar
0 votes
0 answers
60 views

How to reduce loss of Bi-LSTM handwriting recognition model?

I am currently training an bi-LSTM model which predicts the handwriting of an individual. I am hitting a current min loss of 1.2 and I think it is not a problem with the model because I copied a model ...
Mendrix Manlangit's user avatar
0 votes
1 answer
197 views

Does the summing or averaging of the weight gradients have anything to do with the cost function used?

I've been trying to implement my own neural network library and have been wondering if: The SSE loss function includes the summation of the errors in the other training examples of the mini-batch (...
jake_prentice's user avatar
1 vote
1 answer
43 views

What inherent quality of a function makes it treated as either loss or evaluation metric?

A neural network model needs a loss function for training. The neural network needs to minimize the loss function. A neural network is evaluated after training using a metric. The neural network needs ...
hanugm's user avatar
  • 3,820
-1 votes
1 answer
215 views

Why is the cross-entropy a cost function?

The question looks foolish, but I think cross-entropy is somewhat weird as a cost function. As a cost function for linear regression, the mean square error $ \sum_{i=1}^{n} (y_i - (ax_i+b)) ^2$ seems ...
JAEMTO's user avatar
  • 125
3 votes
1 answer
139 views

Custom Tensorflow loss function that disincentivizes all black pixels

I'm training a Tensorflow model that receives an image and segments the image into foreground and background. That is, if the input image is w x h x 3, then the ...
Sam Liu's user avatar
  • 33
1 vote
0 answers
85 views

a loss for binary step function data

I have some data with ground truth that looks like a binary step function, where part of it is 0 and part is one. An example for the GT can be like ...
Alex's user avatar
  • 111
1 vote
0 answers
56 views

GANs: Why does iterative gradient descent sometimes optimise $\min_G \max_D V(D,G)$ and sometimes $\max_D \min_G V(D,G)$?

For the following minimax equation for generative adversarial networks (GANs), $$\min_G \max_D V(D,G) = \mathbb{E}_{\boldsymbol{x}\sim p_{data}(\boldsymbol{x})}[\log D(\boldsymbol{x})] + \mathbb{E}_{\...
James Ellis's user avatar
1 vote
1 answer
582 views

Why are logarithms used in GANs minimax equation?

The minimax equation for generative adversarial networks $$\min_G \max_D V(D,G) = \mathbb{E}_{\boldsymbol{x}\sim p_{data}(\boldsymbol{x})}[\log D(\boldsymbol{x})] + \mathbb{E}_{\boldsymbol{z}\sim p_{\...
James Ellis's user avatar

1
2 3 4 5 6