def binary_hinge_loss(predictions, targets, delta=1, log_odds=None, binary=True):
 if (log_odds is None):
  raise FutureWarning('The `log_odds` argument to `binary_hinge_loss` will change its default to `False` in a future version. Explicitly give `log_odds=True` to retain current behavior in your code, but also check the documentation if this is what you want.')
  log_odds = True
 if (not log_odds):
  predictions = theano.tensor.log((predictions / (1 - predictions)))
 if binary:
  targets = ((2 * targets) - 1)
 (predictions, targets) = align_targets(predictions, targets)
 return theano.tensor.nnet.relu((delta - (predictions * targets)))

def binary_hinge_loss ( predictions , targets , delta = 1 , log_odds = None , binary = True ) : if ( log_odds is None ) : raise FutureWarning ( 'The `log_odds` argument to `binary_hinge_loss` will change its default to `False` in a future version. Explicitly give `log_odds=True` to retain current behavior in your code, but also check the documentation if this is what you want.' ) log_odds = True if ( not log_odds ) : predictions = theano . tensor . log ( ( predictions / ( 1 - predictions ) ) ) if binary : targets = ( ( 2 * targets ) - 1 ) ( predictions , targets ) = align_targets ( predictions , targets ) return theano . tensor . nnet . relu ( ( delta - ( predictions * targets ) ) )
computes the binary hinge loss between predictions and targets .