teras.activations.sparsemax#
- teras.activations.sparsemax(logits, axis=-1)[source]#
Sparsemax activation function as proposed by T. Martins et al. in the paper, “From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification”
- Reference(s):
- Parameters:
logits – Tensor, tensor of logits.
axis (
int) – int, axis along which to apply the sparsemax activation. Defaults to -1.