You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The signature (matrix) => matrix is perhaps not a good idea because it's not immediately clear which dimension it should work over, but maybe there could be pairs of functions softmax_rowwise, softmax_columnwise (which would essentially return stochastic_row_matrix and stochastic_col_matrix respectively) as well as the log variants log_softmax_rowwise, log_softmax_colwise.
Currently the only signature available is
(vector) => vector
But it's somewhat annoying when I want to do this row-wise over a matrix. (To hand-code a similar effect as
stochastic_row_matrix
constraint has)I suggest adding the following signatures:
Softmax for
row_vector
s:(row_vector) => row_vector
And a 'vectorized' variant:
(array[] vector) => array[] vector
(array[] row_vector) => array[] row_vector
The signature
(matrix) => matrix
is perhaps not a good idea because it's not immediately clear which dimension it should work over, but maybe there could be pairs of functionssoftmax_rowwise
,softmax_columnwise
(which would essentially returnstochastic_row_matrix
andstochastic_col_matrix
respectively) as well as the log variantslog_softmax_rowwise
,log_softmax_colwise
.Possibly related: stan-dev/stan#3331
The text was updated successfully, but these errors were encountered: