SoftmaxOperator

public class SoftmaxOperator: ActivationOperator

Softmax activations.

y = exp(x) / reduce_sum(exp(x), dim)

Default dim is the last dimension of input tensors.

Note

The operator assumens all input tensors have same rank. If not, it could not do the calculation.
  • dim

    Reduce summing dimension. The value should be >=0. Any negative value will be automatically making this attribute value to -1.

    Note

    -1 is a special value indicating last dim.

    Declaration

    Swift

    public var dim: Int = -1