Questions tagged [loss]

599 questions
0
votes
2 answers

Keras Custom Losses: Want to track each loss values at the end of each epoch

I would like to check the values of self.losses['RMSE'], self.loss['CrossEntropy'], and self.loss['OtherLoss'] at the end of each epoch. Currently, I can only check the total loss self.loss['total']. def train_test(self): def…
SUNDONG
  • 2,501
  • 5
  • 21
  • 37
0
votes
1 answer

Loss jumps in epoch graph in LSTM model- keras

I see loss jumps in epoch graphs for my LSTM model. (SCREENSHOT attached) What does it tell me? (overfitting?, wrong loss functions, wrong activation Unnecessary layers? etc..) LOSS PLOT # Model time_input= Input(shape=(timesteps,data_dim)) …
MarcusM
  • 15
  • 6
0
votes
0 answers

Weighted binary crossentropy in U-Net (Keras)

I am currently working on a modified version on the U-Net (https://lmb.informatik.uni-freiburg.de/people/ronneber/u-net/) and tried to implement a weighted binary crossentropy loss function in Keras. def weighted_pixelwise_crossentropy(self,…
0
votes
1 answer

Regression Loss function for Multi outputs Keras

I'm using deep learning approach to address a regression problem with multi outputs (16 outputs), each output is between [0,1] and the sum is 1. I am confused about which loss function is ideal to this problem, I have already test Mean squared error…
0
votes
1 answer

Use a $ amount as loss to measure classification performance

I'm working on a fraud detection system, and I would like to optimize the system to take account of the cost (in $) of the reviewing department: I would like to adjust the loss depending on a final cost: If a transaction is fraudulent, but the…
Laurent R
  • 783
  • 1
  • 6
  • 25
0
votes
1 answer

Keras: Best model according to ModelCheckpoint-callback produces different loss on training set than best epoch loss displayed while training

I am trying to train a very simple Keras model with TensorFlow back end in Python. I am aware that the epoch losses displayed in the console while training are calculated 'on the fly' for efficiency and therefore are not necessarily real losses of…
Schmax
  • 1
0
votes
0 answers

How solve non Loss problem in tensorflow in regression model

I have a data base with this shape: (1400000, 44) which the 44th column is output. all numbers are float and between 0 and 1. I used a Tensorflow like below but the loss function is non and the acc is zero. # Create network with Keras import…
Iman
  • 1
0
votes
1 answer

RNN use mean square error does not converge

I am learning RNN through https://medium.com/@erikhallstrm/hello-world-rnn-83cd7105b767. I change the loss function to mean square error and found it does not converge. The output is stuck at 0.5. Somehow, I feel the mistake is inside midlosses =…
John Xu
  • 23
  • 3
0
votes
1 answer

Keras loss function understanding

In order to understand some callbacks of Keras better, I want to artificially create a nan loss. This is the function def soft_dice_loss(y_true, y_pred): from keras import backend as K if K.eval(K.random_normal((1, 1), mean=2, stddev=2))[0][0]…
AljoSt
  • 439
  • 4
  • 19
0
votes
2 answers

Interpretation of train-validation loss of a Neural Network

I have trained an LSTM model for Time Series Forecasting. I have used an early stopping method with a patience of 150 epochs. I have used a dropout of 0.2, and this is the plot of train and validation loss: The early stopping method stop the…
Marco
  • 1,195
  • 3
  • 18
  • 30
0
votes
2 answers

Non-Linear Regression with Keras loss not decreasing: Outlier and/or data format problem?

I'm owning a data table and two of its columns produce a plot that looks like this. Please note, that the Y-Axis is in log. Don't mind the random Kanji. That's already fixed I thought it might be a good idea, to display this relation via a…
0
votes
2 answers

keras:how to get initial loss function value before training

In Keras, I checked the callbacks mechanism. However it does not provide any information before the start of training.Like the output is always after epoch = 1.I would like to check the value of the loss function for the first time feed forward.How…
Ferret Zhang
  • 306
  • 3
  • 8
0
votes
0 answers

Keras: How to calculate loss between different layers?

I wanna calculate loss between different layers, such as the MSE loss between two layers, besides loss between my predict and golden output. So how to calculate it ? For example, input = Input(shape=inputsize) output1 = Dense(50)(input) output2 =…
Caojunjie
  • 69
  • 5
0
votes
1 answer

Tensorflow does not learn

The code: import numpy as np import tensorflow as tf import pandas as pd from sklearn.model_selection import train_test_split x_data = np.linspace(0, 1000, 100000) y_true = np.square(x_data) y_true += np.random.randn(len(x_data)) feature_columns…
mikinoqwert
  • 375
  • 3
  • 15
0
votes
0 answers

Training Sparse Autoencoder in tensorflow

Trying to traing a sparse autoencoder, but from the first epoch its loss showing 'nan'. train dataset is normalized between 0 and 1. ##cost function prediction=decoder_res #output from…