Sparsemax in PyTorch

Is there any PyTorch implementation of Sparsemax [1]? I found the following implementation in Torch:
SparseMax in Torch

[1] Martins, Andre, and Ramon Astudillo. “From Softmax to Sparsemax: A sparse model of attention and multi-label classification.” In ICML 2016.

This might be useful:

1 Like

FYI there is also a pip package now