Loss Node
The Loss Node computes the loss for your model
Custom Loss
@tensorleap_custom_loss("total_loss")
def loss(pred80,pred40,pred20,gt,demo_pred):
gt=np.squeeze(gt,axis=0)
d={}
d["bboxes"] = torch.from_numpy(gt[...,:4])
d["cls"] = torch.from_numpy(gt[...,4])
d["batch_idx"] = torch.zeros_like(d['cls'])
y_pred_torch = [torch.from_numpy(s) for s in [pred80,pred40,pred20]]
all_loss,_= criterion(y_pred_torch, d)
return all_loss.unsqueeze(0).numpy()
Setup
Default losses
Last updated
Was this helpful?

