コード例 #1
0
def poisson(y_true, y_pred):
  return K.mean(y_pred - y_true * K.log(y_pred + K.epsilon()), axis=-1)
コード例 #2
0
def kullback_leibler_divergence(y_true, y_pred):
  y_true = K.clip(y_true, K.epsilon(), 1)
  y_pred = K.clip(y_pred, K.epsilon(), 1)
  return K.sum(y_true * K.log(y_true / y_pred), axis=-1)
コード例 #3
0
def logcosh(y_true, y_pred):

  def cosh(x):
    return (K.exp(x) + K.exp(-x)) / 2

  return K.mean(K.log(cosh(y_pred - y_true)), axis=-1)
コード例 #4
0
def mean_squared_logarithmic_error(y_true, y_pred):
  first_log = K.log(K.clip(y_pred, K.epsilon(), None) + 1.)
  second_log = K.log(K.clip(y_true, K.epsilon(), None) + 1.)
  return K.mean(K.square(first_log - second_log), axis=-1)
コード例 #5
0
ファイル: losses.py プロジェクト: AbhinavJain13/tensorflow
 def _logcosh(x):
   return x + K.softplus(-2. * x) - K.log(2.)
コード例 #6
0
 def _logcosh(x):
     return x + K.softplus(-2. * x) - K.log(2.)