def loss(yTrue, yPred): quantile_in = np.random.random() bellman_errors = yTrue - yPred tau = np.array(quantile_in) print("loss",(K.abs(tau - K.cast(bellman_errors < 0,"float32")) * huber_loss(yTrue,yPred)) / kappa) if kappa > 0: return (K.abs(tau - K.cast(bellman_errors < 0,"float32")) * huber_loss(yTrue,yPred)) / kappa return (K.abs(tau - K.cast(bellman_errors < 0,"float32")) * bellman_errors)
def huber_loss_wrapped_function(y_true, y_pred): return huber_loss(y_true, y_pred, **huber_loss_kwargs)
def reconstruction(img, reconstructed_img): return .5 * huber_loss(img, reconstructed_img) + .5 * DSSIMObjective()( img, reconstructed_img)
def huber_loss_quantile(self,tau): def loss(yTrue,yPred): bellman_errors = yTrue - yPred return (K.abs(tau - K.to_float(bellman_errors < 0)) * huber_loss(yTrue,yPred)) / self.kappa
def loss(yTrue, yPred): bellman_errors = yPred - yTrue #tau = np.array(quantile_in) #print("loss",(K.abs(tau - K.cast(bellman_errors < 0,"float32")) * huber_loss(yTrue,yPred)) / kappa) return (K.abs(tau - K.cast(bellman_errors < 0, "float32")) * huber_loss(yTrue, yPred)) / kappa