Skip to main content

buf2nmfseed

buf2nmfseed(
@buffer ## llll (required)
@converge 0.5
@mincomponents 1
@maxcomponents 100
@method 0
@winsize 1024
@hopsize -1
@fftsize -1
@maxfftsize -1
@useseed 0
) -> llll

Finds initial bases and activations to be used with the buf2nmf function.

buf2nmfseed uses Nonnegative Double Singular Value Decomposition which can help decide how to initialize bases and activations in the buf2nmf function, by suggesting how many components to request (and what bases and activations to seed) in order to account for a certain percentage of the variance in a buffer. In general, using this process to seed a NMF decomposition should substantially increase the speed with which buf2nmf converges and avoid especially poor local minima.

Click here and here for more info.


Arguments

  • @buffer [llll]: Buffer to analyze and suggest a number of components for. (required)
  • @converge [int/float]: Fraction (0 to 1) of information preserved in the decomposition. (default: 0.5).
  • @mincomponents [int]: Minimum number of estimated components to return. (default: 1).
  • @maxcomponents [int]: Maximum number of estimated components to return. (default: 100).
  • @method [int]: The method used to account for certain values before processing. Zeros in the matrix will remain zero when "updated" because the updates are being multiplied by a scalar, therefore it may be useful to change any zeros to something else before the process. (default: 0).
    • 0: NMF-SVD (Nonnegative Double Singular Value Decomposition): any negative values are first converted to their absolute value. This is likely to be quicker than the other options, but less rigorous.
    • 1: NNDSVDar (Nonnegative Double Singular Value Decomposition): any elements that are zero are first filled with a random value between 0 and the average * 0.01 (essentially small random values). This may be slightly faster but slightly less accurate than other options.
    • 2: NNDSVDa (Nonnegative Double Singular Value Decomposition): any elements that are zero are first filled with the average value.
    • 3: NNDSVD (Nonnegative Double Singular Value Decomposition): values are not changed according to any criteria. This promotes sparse results from the subsequent NMF (because, with multiplicative updates, zeros remain zeros). This may or may not be desirable (not least because sparsity implies the need for more components, but also the specific domain might imply that reasonable decomposition just isn't going to be sparse).
  • @winsize [int]: Window size (default: 1024).
  • @hopsize [int]: Hop size. -1 is equivalent to @winsize / 2 (default: -1).
  • @fftsize [int]: FFT size. -1 is equivalent to @winsize snapped to the nearest equal or greater power of 2. (e.g. @winsize 1024 => @fftsize 1024 but @winsize 1000 also => @fftsize 1024) (default: -1).
  • @maxfftsize [int]: Max. FFT size. @maxfftsize -1 is equivalent to whatever the initial FFT size is. (default: -1).
  • @useseed [int]: Use random seed for parameter initialization. (default: 0).
    • 0: Off
    • 1: On

Output

Seed bases and activations for NMF:

[
[ 'bases' <buffers> ] ## learned NMF bases, as buffers
[ 'activations' <buffers> ] ## learned NMF activations, as buffers
]

[llll]