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
0 votes
0 answers
26 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
28 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
21 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
16 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
38 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
0 answers
34 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
31 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
38 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
301 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
0 votes
1 answer
26 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
0 answers
66 views

Why is cross entropy loss averaged and not used directly as a sum during model training?

Why is the cross-entropy loss for all training examples (or the training examples in a batch) averaged over the size of the training set (or batch size)? Why is it not just summed up and used?
StudentV's user avatar
0 votes
0 answers
43 views

Training a neural network to produce a relative score of input values

I am considering training a neural network to place a number of data items into a list ordered by priority, so that the most important items are dealt with first and the least important are dealt with ...
occipita's user avatar
  • 131
0 votes
1 answer
243 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
2k 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
0 votes
0 answers
93 views

How do Deep Momentum Networks work?

Here is a paper about Deep Momentum Networks: https://arxiv.org/pdf/1904.04912.pdf From what I understand, they are a neural network that's used for stock trading, that uses the Sharpe Ratio as a loss ...
user avatar
0 votes
0 answers
35 views

What loss function should I use to penalize shift properly

I'm trying to fit a set of parameters $\mathbf{p} \in \mathbb{R}^P$ to a 1D function $\hat{f}(t)$ (e.g. waveform, time-series) where $t\in\mathbb{R}$ is the time coordinate of the signal $\hat{f}\in\...
Firman's user avatar
  • 111
2 votes
1 answer
121 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
402 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
33 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
42 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
66 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
300 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
50 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
129 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
213 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?...
not another narcissist's user avatar
0 votes
2 answers
67 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
8 votes
1 answer
6k 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
  • 293
1 vote
2 answers
774 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
280 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
28 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
233 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
75 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
  • 370
0 votes
0 answers
57 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 ...
eldorado's user avatar
7 votes
2 answers
7k 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
128 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
191 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,612
-1 votes
1 answer
205 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
129 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
77 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
55 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
502 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
2 votes
2 answers
842 views

What specifically is the gradient of the log of the probability in policy gradient methods?

I am getting tripped up slightly by how specifically the gradient is calculated in policy gradient methods (just the intuitive understanding of it). This Math Stack Exchange post is close, but I'm ...
user9317212's user avatar
1 vote
1 answer
595 views

Test accuracy decreases during my train process

I want to train a neural network model with the arcface loss function and try to combine it with domain adaption. But when the training process continues, I find the test accuracy first increases and ...
klayoe's user avatar
  • 11
1 vote
0 answers
68 views

Where do the objective functions proposed in this paper by Carlini-Wagner attack come from?

I'm trying to understand the paper by Carlini and Wagner on deep neural networks adversarial attacks. On page 44, in Section V-A, it is explained how the loss function to the described problem was ...
Piotrek's user avatar
  • 111

1
2 3 4 5 6