dsnt icon indicating copy to clipboard operation
dsnt copied to clipboard

Defining loss function

Open AceMcAwesome opened this issue 4 years ago • 1 comments

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?

AceMcAwesome avatar Oct 14 '20 23:10 AceMcAwesome

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 :/

MrJBS avatar Feb 18 '22 17:02 MrJBS