Developer Guide for Intel® Data Analytics Acceleration Library 2019 Update 5
The loss softmax cross-entropy layer implements an interface of the loss layer.
For an input tensor X ∈ R n 1 x n 2 x ... x n k x ... x n p , selected dimension k of size n k , and ground truth tensor T ∈ R n 1 x n 2 x ... x 1 x ... x n p , the layer computes a one-dimensional tensor with the cross-entropy value:
Given:
The p-dimensional tensor X = (x j 1...j k ...j p ) ∈ R n 1 x n 2 x ... x n k x ... x n p with input data
The problem is to compute a one-dimensional tensor Y ∈ R 1 such that:
The library uses the numerically stable formula for computing the probability value s j 1...j k-1 i j k+1..j p :