Skip to main content
. 2021 Apr 6;15:549322. doi: 10.3389/fnins.2021.549322
 function row_sample(A,s)
       Let à be an empty matrix
       for t = 1 to s do
             Randomly sample a row according to the distribution P
             Let Ait, ⋆ be the sampled row, with corresponding probability pi
             Set A˜t,=1spiAit,
       end for
 return à and row indices
 end function