Mercurial > hg > nimfks
comparison src/matlab/nmf_beta.m @ 0:c52bc3e8d3ad tip
user: boblsturm
branch 'default'
added README.md
added assets/.DS_Store
added assets/playButton.jpg
added assets/stopButton.png
added assets/swapButton.jpg
added data/.DS_Store
added data/fiveoctaves.mp3
added data/glock2.wav
added data/sinScale.mp3
added data/speech_female.mp3
added data/sweep.wav
added nimfks.m.lnk
added src/.DS_Store
added src/matlab/.DS_Store
added src/matlab/AnalysisCache.m
added src/matlab/CSS.m
added src/matlab/DataHash.m
added src/matlab/ExistsInCache.m
added src/matlab/KLDivCost.m
added src/matlab/LoadFromCache.m
added src/matlab/SA_B_NMF.m
added src/matlab/SaveInCache.m
added src/matlab/Sound.m
added src/matlab/SynthesisCache.m
added src/matlab/chromagram_E.m
added src/matlab/chromagram_IF.m
added src/matlab/chromagram_P.m
added src/matlab/chromsynth.m
added src/matlab/computeSTFTFeat.m
added src/matlab/controller.m
added src/matlab/decibelSliderReleaseCallback.m
added src/matlab/drawClickCallBack.m
added src/matlab/fft2chromamx.m
added src/matlab/hz2octs.m
added src/matlab/ifgram.m
added src/matlab/ifptrack.m
added src/matlab/istft.m
added src/matlab/nimfks.fig
added src/matlab/nimfks.m
added src/matlab/nmfFn.m
added src/matlab/nmf_beta.m
added src/matlab/nmf_divergence.m
added src/matlab/nmf_euclidean.m
added src/matlab/prune_corpus.m
added src/matlab/rot_kernel.m
added src/matlab/templateAdditionResynth.m
added src/matlab/templateDelCb.m
added src/matlab/templateScrollCb.m
author | boblsturm |
---|---|
date | Sun, 18 Jun 2017 06:26:13 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c52bc3e8d3ad |
---|---|
1 function [ Y, cost ] = nmf_beta( V, W, varargin ) | |
2 | |
3 if nargin > 2 | |
4 nmf_params = varargin{1}; | |
5 iterations = nmf_params.Iterations; | |
6 lambda = nmf_params.Lambda; | |
7 beta = nmf_params.Beta % 1: KL Divergence; 2: Euclidean | |
8 end | |
9 | |
10 cost=0; | |
11 K=size(W, 2); | |
12 M=size(V, 2); | |
13 | |
14 H=random('unif',0, 1, K, M); | |
15 | |
16 V = V+1E-6; | |
17 W = W+1E-6; | |
18 | |
19 for l=1:L-1 | |
20 recon = W*H; | |
21 num = H.*(W'*(((recon).^(beta-2)).*V)); | |
22 den = W'*((recon).^(beta-1)); | |
23 H = num./den; | |
24 end | |
25 | |
26 fprintf('Iterations: %i/%i\n', l, L); | |
27 fprintf('Convergence Criteria: %i\n', convergence*100); | |
28 fprintf('Repitition: %i\n', r); | |
29 fprintf('Polyphony: %i\n', p); | |
30 fprintf('Continuity: %i\n', c); | |
31 | |
32 Y=H; | |
33 Y = Y./max(max(Y)); %Normalize activations | |
34 | |
35 end |