# log_loss¶

Negative Log Loss Layer

This layer accepts input predictions and target label and returns the negative log loss.

$Out = -label * \log{(input + \epsilon)} - (1 - label) * \log{(1 - input + \epsilon)}$
Parameters
• input (Variable|list) – A 2-D tensor with shape [N x 1], where N is the batch size. This input is a probability computed by the previous operator. Data type float32.

• label (Variable|list) – The ground truth which is a 2-D tensor with shape [N x 1], where N is the batch size. Data type float32.

• epsilon (float, optional) – A small number for numerical stability. Default 1e-4.

• name (str|None) – For detailed information, please refer to Name . Usually name is no need to set and None by default.

Returns

A 2-D tensor with shape [N x 1], the negative log loss.

Return type

Variable

Examples