Developer Guide for Intel® Data Analytics Acceleration Library 2019 Update 2

Loss Logistic Cross-entropy Forward Layer

The loss logistic cross-entropy layer implements an interface of the loss layer.

For a two-dimensional input tensor X R n 1 x 1 with batch dimension of size n 1 and two-dimensional T R n 1 x 1, the layer computes a one-dimensional tensor Y with the logistic cross-entropy value:



where log is the natural logarithm, σ(x) is the logistic function, and pr i ∈ [0,1] is the probability that a sample belongs to the first of two classes.

Problem Statement

Given:

The problem is to compute a one-dimensional tensor Y R 1 such that:







The library uses the numeric stable formula for computing the value of s i :



where

Note

If the input p-dimensional tensor has the size of n 1 x 1 x ... x 1, insert the reshape layer before the logistic loss layer to get the required n 1 x 1 size of the input tensor.