This function applies the softmax transformation along the third dimension
of a 3D array. The softmax function converts raw scores into probabilities
such that they sum to 1 for each slice along the third dimension.
Usage
softmax_3d(x)
Value
A 3D array of the same dimensions as x, where the values along the
third dimension are transformed using the softmax function.
Arguments
x
A 3D array. The input array on which the softmax function will be applied.
Details
The softmax transformation is computed as:
$$\text{softmax}(x_{ijk}) = \frac{\exp(x_{ijk})}{\sum_{l} \exp(x_{ijl})}$$
This is applied for each pair of indices (i, j) across the third dimension (k).
The function processes the input array slice-by-slice for the first two dimensions
(i, j), normalizing the values along the third dimension (k) for each slice.