I'm trying to train DNN that outputs 3 values (x,y,z)
where x
and y
are coordinates of the object I'm looking for and z
is the probability that object is present
I need custom loss function:
If z_true<0.5
I don't care of x
and y
values, so error should be equal to (0, 0, sqr(z_true - z_pred))
otherwise error should be like (sqr(x_true - x_pred), sqr(y_true - y_pred), sqr(z_true - z_pred))
I'm in a struggle with mixing tensors and if statements together.