wolffd@0: % --- wolffd@0: % This script plots 50-dimensional RBM features as in figure 2 of wolffd@0: % wolffd@0: % Feature Preprocessing with RBMs for Music Similarity Learning wolffd@0: % Son N. Tran, Daniel Wolff, Tillman Weyde, Artur Garcez, AES53rd wolffd@0: % conference wolffd@0: % --- wolffd@0: wolffd@0: % cr_: training correct wolffd@0: % cr : testing correct wolffd@0: feature_file = 'rel_music_raw_features+simdata_ISMIR12'; wolffd@0: vars = whos('-file', feature_file); wolffd@0: A = load(feature_file,vars(1).name,vars(2).name,vars(3).name,vars(4).name); wolffd@0: raw_features = A.(vars(1).name); wolffd@0: indices = A.(vars(2).name); wolffd@0: tst_inx = A.(vars(3).name); wolffd@0: trn_inx = A.(vars(4).name); wolffd@0: % wolffd@0: figure(1); imagesc(raw_features);colorbar; wolffd@0: title 'Original Features'; wolffd@0: wolffd@0: % load pregenerated RBM features wolffd@0: mod = load('rbm_50'); wolffd@0: wolffd@0: % --- wolffd@0: % uncomment the following line to use newly calculated RBM features wolffd@0: % mod = new_rbm(50,'grad'); wolffd@0: % --- wolffd@0: wolffd@0: features = logistic(raw_features*mod.W_max{1} + repmat(mod.hB_max{1},size(raw_features,1),1)); wolffd@0: figure(2); imagesc(features);colorbar; wolffd@0: title 'RBM Features'; wolffd@0: wolffd@0: num_case = size(trn_inx,1); wolffd@0: [trnd_12 trnd_13] = subspace_distances(trn_inx,features,indices,1,1); wolffd@0: [tstd_12 tstd_13] = subspace_distances(tst_inx,features,indices,1,1); wolffd@0: cr_ = 0; % correct rate for training wolffd@0: cr = 0; % correct rate for testing wolffd@0: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%