Commit f535c004 by Tiago de Freitas Pereira

### [sphinx] Fixed warnings

parent 82a4e253
Pipeline #4890 passed with stages
in 9 minutes and 53 seconds
 from .LossFunction import LossFunction import numpy import numpy from . import LossFunction class ExponentialLoss (LossFunction): """ The class implements the exponential loss function for the boosting framework.""" class ExponentialLoss(LossFunction): """ The class implements the exponential loss function for the boosting framework.""" def loss(self, targets, scores): def loss(self, targets, scores): """The function computes the exponential loss values using prediction scores and targets. """The function computes the exponential loss values using prediction scores and targets. ... @@ -21,7 +20,6 @@ class ExponentialLoss (LossFunction): ... @@ -21,7 +20,6 @@ class ExponentialLoss (LossFunction): """ """ return numpy.exp(-(targets * scores)) return numpy.exp(-(targets * scores)) def loss_gradient(self, targets, scores): def loss_gradient(self, targets, scores): """The function computes the gradient of the exponential loss function using prediction scores and targets. """The function computes the gradient of the exponential loss function using prediction scores and targets. ... @@ -36,4 +34,3 @@ class ExponentialLoss (LossFunction): ... @@ -36,4 +34,3 @@ class ExponentialLoss (LossFunction): """ """ loss = numpy.exp(-(targets * scores)) loss = numpy.exp(-(targets * scores)) return -targets * loss return -targets * loss
 from .LossFunction import LossFunction from . import LossFunction import numpy import numpy class LogitLoss(LossFunction): class LogitLoss(LossFunction): """ The class to implement the logit loss function for the boosting framework.""" """ The class to implement the logit loss function for the boosting framework.""" ... @@ -20,7 +21,6 @@ class LogitLoss(LossFunction): ... @@ -20,7 +21,6 @@ class LogitLoss(LossFunction): e = numpy.exp(-(targets * scores)) e = numpy.exp(-(targets * scores)) return numpy.log(1. + e) return numpy.log(1. + e) def loss_gradient(self, targets, scores): def loss_gradient(self, targets, scores): """The function computes the gradient of the logit loss function using prediction scores and targets. """The function computes the gradient of the logit loss function using prediction scores and targets. ... @@ -34,5 +34,5 @@ class LogitLoss(LossFunction): ... @@ -34,5 +34,5 @@ class LogitLoss(LossFunction): loss (float <#samples, #outputs>): The gradient of the loss based on the given scores and targets. loss (float <#samples, #outputs>): The gradient of the loss based on the given scores and targets. """ """ e = numpy.exp(-(targets * scores)) e = numpy.exp(-(targets * scores)) denom = 1./(1. + e) denom = 1. / (1. + e) return -targets * e * denom return -targets * e * denom