nnf_contrib_sparsemax: Sparsemax

View source: R/nnf-activation.R

nnf_contrib_sparsemaxR Documentation

Sparsemax

Description

Applies the SparseMax activation.

Usage

nnf_contrib_sparsemax(input, dim = -1)

Arguments

input

the input tensor

dim

The dimension over which to apply the sparsemax function. (-1)

Details

The SparseMax activation is described in 'From Softmax to Sparsemax: A Sparse Model of Attention and Multi-Label Classification' The implementation is based on aced125/sparsemax


torch documentation built on June 7, 2023, 6:19 p.m.