utils
↳ stoclust
Contains miscellaneous useful functions.
Functions
-
block_sum(a, blocks, axis=0)
Given an array and a list of index blocks along a given axis, delivers a new array whose indices correspond to blocks and whose entries are sums over the old values.
-
sinkhorn_knopp(mat, num_iter=100, rescalings=False)
Given a matrix of weights, generates a bistochastic matrix using the Sinkhorn-Knopp algorithm.
-
stoch(weights, axis=-1)
Reweights each row along a given axis such that sums along that axis are one.