'How Keras customer loss function can consider the y_pred index and value order in y_pred
I am trying to write customer loss function in Keras. My case is in the y_pred, some samples have true labels in y_true, some samples don't have y_true label (a dummy label is given in this case). For the samples without true label, the predicted values of these samples should follow a monotonic increase order with sample index. Or in other words, those samples without labels should not decrease when sample index increases. I am trying to write a loss function to sum the loss from labeled samples and the loss of unlabeled samples (when there is a value decrease with increasing index). I tried different ways but it doesn't work, usually giving error no gradient for the variables. Could someone help me on this and give some ideas or directions how I should do it? Thanks.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
