dsnt
dsnt copied to clipboard
Defining loss function
How do I define my loss function when it's my understanding that custom loss functions are only supposed to take 2 inputs, y_true and y_pred? For example here those are targets and coords:
def loss_function(targets, coords): loss_1 = tf.losses.mean_squared_error(targets, coords) loss_2 = dsnt.js_reg_loss(norm_heatmaps, targets) loss = loss_1 + loss_2 return loss
But how do I get norm_heatmaps passed to the loss function?
Hello @AceMcAwesome , have you managed to implement a custom tf-loss function? I was just about to try this implementation on my tf-model, but I am getting nowhere as my function produces many errors that I do not understand. I understand that my model needs to produce an output with the predicted coordinates and the heatmap, but then I don't know what to do :/