stnmf.init.random
- stnmf.init.random(v, r, rng=None, dtype='float32')
Initialize feature matrix by random sampling
- Parameters:
v (
(n,m) array_like) – Input matrixr (
int) – Number of componentsrng (
numpy.random.GeneratororintorNone, optional) – Random number generator (RNG) instance. If integer, it will be the seed for initializing a new RNG. If None, the RNG will be initialized without a seed based on OS context. Default is Nonedtype (
strortype, optional) – Number format with which to calculate. Default is ‘float32’
- Returns:
w (
(n,r) numpy.ndarray) – Initialized w
See also
stnmf.util.create_rngCreate an RNG instance