Пример #1
0
		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)
Пример #2
0
 def huber_loss_wrapped_function(y_true, y_pred):
     return huber_loss(y_true, y_pred, **huber_loss_kwargs)
Пример #3
0
def reconstruction(img, reconstructed_img):
    return .5 * huber_loss(img, reconstructed_img) + .5 * DSSIMObjective()(
        img, reconstructed_img)
Пример #4
0
	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
Пример #5
0
 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