
The following shows a standard GAN model:
def define_gan(g_model, d_model, image_shape):
# make weights in the discriminator not trainable
d_model.trainable = False
# define the source ...

I am trying to achieve the segmentation of the bone on the cross sectional area of MRI images with the Unet I found here https://github.com/zhixuhao/unet. The label is a binary png image which I ...

I met a very strange problem. I am training a deep learning model, and the code is:
finalModel.compile(
optimizer=optimizer,
loss=dice_loss,
metrics=[keras....

What will be the corresponding keras backend implementation of given mapk function (mean absolute precision function at k) implemented using numpy? I want to use this as the error function in my RNN ...

I am using a custom Mean Average Precision error function in my keras model:
def apk(actual, predicted, k=3):
actual = list(actual)
predicted = list(predicted)
if len(predicted)>k:
...

I am trying to predict a continuous value by using the previous data. I'm using LSTM for my time series prediction. My data has 800 rows. I have set the time_step as 100. I have 1 feature.
I created ...

# Importing the required Keras modules containing model and layers
from keras.models import Sequential
from keras.layers import Dense, Conv2D, Dropout, Flatten, MaxPooling2D,Conv2DTranspose
from keras....

I'm trying to do loss function in Keras as in Pytorch https://pytorch.org/docs/master/generated/torch.nn.MultiLabelMarginLoss.html
but it's taking a lot of time to do model.compile and after that it ...

I have build a simpel DL net with the Pytorch ResNet API to train the Stanford Cars Dataset. My task is image classification. I use the CrossEntropyLoss as my loss function.
transform = T.Compose([
...

I am working on an imagesegmentation application where the loss function is Dice loss. The issue is the the loss function becomes NAN after some epochs. I am doing 5fold cross validation and ...

I'm making this neural network to classify structured data to 5 different classes.
Here is the code :
(sorry if it is too long, I'm knew to this)
import tensorflow as tf
from keras.models import ...

Hi. I am running this code. This give me the result for training loss. But when i print test loss and accuracy it returns 'Nan' as output. Please guide me why this code is not giving me the test ...

I have been trying to perform a comparison between pytorch and tensorflow on a variational autoencoder model. I have built exactly the same model on both. However, the pytorch model outperforms the ...

Is there a difference between these two codes?
1
Loss.backward(retain_graph=True)
Loss.backward(retain_graph=True)
Loss.backward()
optimizer.step
2
Loss = 3 * Loss
Loss.backward()
optimizer.step
...

I am confused about the loss function in PyTorch. Some people define the loss function as a normal python function while others define the loss function by defining a class that inherits nn.Module. So ...

I am building an Autoencoder using Keras model. I want to built a custom loss in the form of alpha* L2(x, x_pred) + beta * L1(day_x, day_x_pred). The second term of L1 loss to penalize regarding to ...

I am using binary cross entropy, and I have 2 epochs:
batch_size = 32
epochs = 2
History = model.fit(padded_train, y_train, batch_size = batch_size, epochs = epochs, validation_split = 0.1)
Now i ...

I train efficientdet b0, with 1 image without random transform, validation have the same 1 image, and batchsize=1, but I get the following, while use the saved weight to inference, result not very ...

When viewing the code for how XGBoost calculates the tweedie evaluation metric (tweedienloglik) we can see that it is calculated as:
bst_float a = y * std::exp((1  rho_) * std::log(p)) / (1  rho_);...

i used tensorboard for my pytorch project and got this result for accuracy/train and loss/train but i dont understand what it means

I want to implement a wrapped loss function in TensorFlow 2.0, like the following:
def wrapped_loss(tensor1):
def loss(y_actual,y_pred):
mse_error = tf.reduce_mean(tf.math.square(tf.math....

I work under linux debian buster.
This morning I worked as usual and my PC crashed. I forced it to shut down and when I restarted, it presents the terminal with initramfs (if I'm not mistaken) by ...

I want to write a custom loss function for my neural network in TensorFlow. It is clear to me how to write a simple custom loss function but I want the loss function to be dependent upon the predicted ...

I have the RMSE loss, defined as :
RMSE = np.sum(np.sqrt((np.array(pred_df.real_values)  np.array(pred_df.estimate_values))**2))
where the real values and predictions are between 0.0 and 5.0 .
I ...

i made a neural network with keras in python and cannot really understand what the loss function means.
So here first some general information:
i worked with the poker hand dataset with classes 09, ...

Most of the resources suggested to use BCE loss because of its perclass punishment, but I 've found examples that illustrate that CE loss performs better than BCE loss in multilabel task. For ...

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 might ...

I know that the problem can't be with the dataset because I've seen other projects use the same dataset.
Here is my data preprocessing code:
import pandas as pd
dataset = pd.read_csv('...

For a binary classification problem with batch_size = 1, I have logit and label values using which I need to calculate loss.
logit: tensor([0.1198, 0.1911], device='cuda:0', grad_fn=<AddBackward0&...

I'm pretraining BERT with Bulgarian dataset on a single Cloud TPU v2 8 using the original parameters (learning rate = 5e5, training batch size = 32, number of training steps = 100000).
The problem ...

I am training a speech to text model. On the very first epoch, the WER is 0.33, for 2nd epoch WER is still the same, however training loss has increased while the validation loss has decreased.
...

Have one doubt. I am also using mask rcnn but tensorflow is 2.0. I am trying to run the tensorboard but I am only getting one loss(plotting graph using tensorboardonly one loss) instead of each loss ...

I am training a classification model to classify cells, and my model is based on this paper: https://www.nature.com/articles/s41598019500109. As my dataset consists of only 10 images, I performed ...

My neural network trainign in pytorch is getting very wierd.
I am training a known dataset that came splitted into train and validation.
I'm shuffeling the data during training and do data ...

my model looks like
Single output multiple loss functions in Keras : https://stackoverflow.com/a/51705573/9079093
model = Model(inputs=[sketch_inp, color_inp], outputs=disc_outputs)
opt = Adam(lr=...

If I use a batch_size of 32 in an LSTM made with Keras, is the loss function applied to each sequence and then averaged, or is it applied directly to all sequences without taking each sequence into ...

I am trying to make a model with dark flow to detect asphalt damages following this git hub page : https://github.com/thtrieu/darkflow
I have tried by different ways such as trying different ...

Suppose we have problem where we have 100 images and a batch size of 15. We have 15 images in all of out batches except our last batch which contains 10 images.
Suppose we have network training as:
...

I used loss_val.item() instead of loss_val.data[0] in my code because new version of python do not support that but as you can see here but I receive Error for gathering Loss in list
" 'float' ...

Im running a rather simple Keras classification, based on 30 features. What I dont get to understand yet is why the loss function gets way more volatile if I increase the number of rows going into the ...

I'm trying to predict the stock price of Tesla taking tweets into account. I try to classify the stock price going up or down each hour. Obviously it's very hard to predict it and so I get mixed ...

For educational purposes I've been creating deep learning library for some time now. Few days ago I received a task
for intern position to create a model from scratch using numpy which will classify ...

def custom_loss(lmbda , regularizer_value):
def loss(y_true , y_pred):
return K.categorical_crossentropy(y_true ,y_pred) + lmbda * regularizer_value
return loss
model_loss = custom_loss(...

I was trying to use tfrecords to train the PNet of MTCNN. At first the loss was decreasing smoothly for the first few epochs and then it became 'nan' and so did the model weights.
Below are my model ...

I implemented an MLP with a custom loss function, here is the code:
def custom_loss(groups_id_count):
print('Computing loss...')
def listnet_loss(real_labels, predicted_labels):
start_range = ...

Hi, I've been reading the paper, published in NIPS2019. The name of the paper is 'Unsupervised Scalable Representation Learning for multivariate time series'. The author combines the idea of triplet ...

I want to train a model with a custom loss function, in order to do that, I need to convert the tensor to numpy array inside the method below:
def median_loss_estimation(y_true, y_predicted):
a = ...

Im trying to create my own object detector using tensorflow api pretrained model: faster_rcnn_inception_v2_coco,
and im working with GoogleColab.
First thing I did was collecting training data, and ...

I just started to work with tensorflow 2.0 and followed the simple example from its official website.
import tensorflow as tf
import tensorflow.keras.layers as layers
mnist = tf.keras.datasets....

I am new to CNNs. I tried to train my model on CIFAR10 dataset. I used the concept of transfer learning where my basemodel is InceptionV3 and my output layer has 10 nodes. So i used softmax to ...