loss Questions
3
Solved
I want to create a L2 loss function that ignores values (=> pixels) where the label has the value 0. The tensor batch[1] contains the labels while output is a tensor for the net output, both have a...
Nysa asked 29/1, 2018 at 22:3
2
Solved
I'm trying to calculate MSELoss when mask is used. Suppose that I have tensor with batch_size of 2: [2, 33, 1] as my target, and another input tensor with the same shape. Since sequence length migh...
Captious asked 3/5, 2020 at 18:59
3
I was wondering how to interpret different losses in the YOLOv8 model. I've easily found explanations about the box_loss and the cls_loss. About the dfl_loss I don't find any information on the Int...
5
To be precise, the loss function that I'm looking for is the squared error when the absolute error is lesser than 0.5, and it is the absolute error itself, when the absolute error is greater than 0...
Banerjee asked 23/8, 2016 at 16:48
3
According to the PyTorch documentation, the advantage of the class BCEWithLogitsLoss() is that one can use the
log-sum-exp trick for numerical stability.
If we use the class BCEWithLogitsLoss() w...
Devolution asked 1/4, 2021 at 14:58
4
Solved
I Can calculate accuracy after each epoch using this code . But, I want to calculate the accuracy for each class at the end . how can i do that?
I have two folders train and val . each folder has 7...
Sauger asked 17/7, 2020 at 16:35
4
Solved
For a very simple classification problem where I have a target vector [0,0,0,....0] and a prediction vector [0,0.1,0.2,....1] would cross-entropy loss converge better/faster or would MSE loss?
When...
Spiro asked 16/3, 2018 at 13:41
5
Solved
I need convert all videos to my video player (in website) when file type is other than flv/mp4/webm.
When I use: ffmpeg -i filename.mkv -sameq -ar 22050 filename.mp4 :
[h264 @ 0x645ee0] error w...
1
I'd like to have a model with 3 regression outputs, such as the dummy example below:
import torch
class MultiOutputRegression(torch.nn.Module):
def __init__(self):
super(MultiOutputRegression, ...
Xyster asked 17/6, 2021 at 1:1
1
Is it possible to set model.loss in a callback without re-compiling model.compile(...) after (since then the optimizer states are reset), and just recompiling model.loss, like for example:
class N...
5
Solved
I have run deep learning models(CNN's) using tensorflow. Many times during the epoch, i have observed that both loss and accuracy have increased, or both have decreased. My understanding was that b...
Criticism asked 1/12, 2016 at 12:35
3
Solved
I want to implement a custom loss function in Python and It should work like this pseudocode:
aux = | Real - Prediction | / Prediction
errors = []
if aux <= 0.1:
errors.append(0)
elif aux >...
Shanda asked 27/4, 2018 at 11:25
2
I am training a keras model whose last layer is a single sigmoid unit:
output = Dense(units=1, activation='sigmoid')
I am training this model with some training data in which the expected output i...
1
I am working on an image-segmentation application where the loss function is Dice loss. The issue is the the loss function becomes NAN after some epochs. I am doing 5-fold cross validation and chec...
Montoya asked 8/6, 2020 at 9:36
2
Solved
I have a model in Keras which I'm optimizing the mean squared error. However, if I use the same code as in losses.py from Keras in the metric, I get a different result. Why is this?
As a metric:
...
Illconsidered asked 10/2, 2018 at 10:7
4
Solved
Cross entropy formula:
But why does the following give loss = 0.7437 instead of loss = 0 (since 1*log(1) = 0)?
import torch
import torch.nn as nn
from torch.autograd import Variable
output = Var...
Haleyhalf asked 20/3, 2018 at 17:39
3
Solved
I am using a multiple output model in Keras
model1 = Model(input=x, output=[y2, y3])
model1.compile((optimizer='sgd', loss=cutom_loss_function)
my custom_loss function is
def custom_loss(y_tru...
Ophiolatry asked 25/5, 2017 at 4:15
1
I'm training a U-Net CNN in Keras/Tensorflow and find that loss massively decreases between the last batch of the first epoch, and the first batch of the second epoch:
Epoch 00001: loss improved fr...
1
Solved
I am training a classification model to classify cells, and my model is based on this paper: https://www.nature.com/articles/s41598-019-50010-9. As my dataset consists of only 10 images, I performe...
Rockwell asked 22/4, 2020 at 10:8
2
I'm trying to predict price by characteristics.
I chose a pretty simple model, but it works very strange. Loss function is extremely high and I can't see where the problem is.
Here is my model:
...
Kenleigh asked 2/9, 2017 at 14:20
2
Solved
I know that in theory, the loss of a network over a batch is just the sum of all the individual losses. This is reflected in the Keras code for calculating total loss. Relevantly:
for i in range(...
Dahabeah asked 4/9, 2018 at 19:30
2
Solved
What can cause loss from model.get_latest_training_loss() increase on each epoch?
Code, used for training:
class EpochSaver(CallbackAny2Vec):
'''Callback to save model after each epoch and sho...
1
Solved
I have the following evaluation metrics on the test set, after running 6 models for a binary classification problem:
accuracy logloss AUC
1 19% 0.45 0.54
2 67% 0.62 0.67
3 66% 0.63 0.68
4 67% 0.6...
Buzzell asked 29/10, 2019 at 15:4
1
Solved
I am building a deep regression network (CNN) to predict a (1000,1) target vector from images (7,11). The target usually consists of about 90 % zeros and only 10 % non-zero values. The distribution...
Walling asked 23/8, 2019 at 0:31
3
in keras, I want to customize my loss function which not only takes (y_true, y_pred) as input but also need to use the output from the internal layer of the network as the label for an output layer...
1 Next >
© 2022 - 2024 — McMap. All rights reserved.