comparison reproduce_AES53rd/rerun_figure2.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % ---
2 % This script plots 50-dimensional RBM features as in figure 2 of
3 %
4 % Feature Preprocessing with RBMs for Music Similarity Learning
5 % Son N. Tran, Daniel Wolff, Tillman Weyde, Artur Garcez, AES53rd
6 % conference
7 % ---
8
9 % cr_: training correct
10 % cr : testing correct
11 feature_file = 'rel_music_raw_features+simdata_ISMIR12';
12 vars = whos('-file', feature_file);
13 A = load(feature_file,vars(1).name,vars(2).name,vars(3).name,vars(4).name);
14 raw_features = A.(vars(1).name);
15 indices = A.(vars(2).name);
16 tst_inx = A.(vars(3).name);
17 trn_inx = A.(vars(4).name);
18 %
19 figure(1); imagesc(raw_features);colorbar;
20 title 'Original Features';
21
22 % load pregenerated RBM features
23 mod = load('rbm_50');
24
25 % ---
26 % uncomment the following line to use newly calculated RBM features
27 % mod = new_rbm(50,'grad');
28 % ---
29
30 features = logistic(raw_features*mod.W_max{1} + repmat(mod.hB_max{1},size(raw_features,1),1));
31 figure(2); imagesc(features);colorbar;
32 title 'RBM Features';
33
34 num_case = size(trn_inx,1);
35 [trnd_12 trnd_13] = subspace_distances(trn_inx,features,indices,1,1);
36 [tstd_12 tstd_13] = subspace_distances(tst_inx,features,indices,1,1);
37 cr_ = 0; % correct rate for training
38 cr = 0; % correct rate for testing
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%