wolffd@0: % --- wolffd@0: % this script trains similarity measures using RBM and SVM as in Table 3 wolffd@0: % please note that the RBM training is a probabilistic process. wolffd@0: % Here, training is done on 20 random initialisations of RBM features , wolffd@0: % the test results corresponding to the RBM with the best training result are then wolffd@0: % returned. wolffd@0: % --- wolffd@0: wolffd@0: % --- wolffd@0: % vary feature parameters of mixed features wolffd@0: % --- wolffd@0: wolffd@0: global globalvars; wolffd@0: globalvars.debug = 3; wolffd@0: wolffd@0: ftype = 'MTTMixedFeatureSonRBM'; %'MTTMixedFeatureStober11Genre'; wolffd@0: wolffd@0: fparams_all = struct(... wolffd@0: ... % --- wolffd@0: ... % these are SONfeatRaw parameters wolffd@0: ... % --- wolffd@0: 'son_filename',{{'rel_music_raw_features+simdata_ISMIR12.mat'}}, ... wolffd@0: 'son_conf', 1:5, ... wolffd@0: ... % --- wolffd@0: ... % Following: RBM params wolffd@0: ... % --- wolffd@0: 'norm_pre_rbm', 0, ... % norm before RBM? wolffd@0: 'norm_post_rbm',0, ... % norm before RBM? wolffd@0: 'rbm_hidNum',[1000], ... % number of hidden units % 500 wolffd@0: 'rbm_eNum', 100, ... wolffd@0: 'rbm_bNum', 1, ... wolffd@0: 'rbm_gNum', 1, ... wolffd@0: 'rbm_lrate1' , [0.05], ... % initial learning rate % 0.01 wolffd@0: 'rbm_lrate2', [0.10], ... % learning rate, %0.05 wolffd@0: 'rbm_momentum', [0.1], ... % 0.5 wolffd@0: 'rbm_cost', [0.00002], ... % cost function wolffd@0: 'rbm_N', 50, ... wolffd@0: 'rbm_MAX_INC', 10 ... wolffd@0: ); wolffd@0: wolffd@0: % --- wolffd@0: % vary parameters for svmlight wolffd@0: % --- wolffd@0: wolffd@0: trainparams_all = struct(... wolffd@0: 'C', [1], ...% wolffd@0: 'weighted', [0], ... wolffd@0: 'dataset', {{'comp_partBinData_ISMIR12_01.mat'}}, ... wolffd@0: 'inctrain', 0 ... wolffd@0: ... % this optional wolffd@0: ... %'deltafun', {{'conv_subspace_delta'}}, ... wolffd@0: ... %'deltafun_params', {{{[1],[0]},{[5],[1]},{[10],[1]},{[20],[1]},{[30],[1]},{[50],[1]},{[70],[1]}}} ... % normalisation improves results wolffd@0: ); wolffd@0: wolffd@0: % set training function wolffd@0: trainfun = @svmlight_wrapper; wolffd@0: wolffd@0: wolffd@0: % create test directory wolffd@0: akt_dir = migrate_to_test_dir(); wolffd@0: wolffd@0: wolffd@0: % call eval wolffd@0: out = test_generic_features_parameters_crossval... wolffd@0: (fparams_all, trainparams_all, trainfun, ftype); wolffd@0: wolffd@0: % --- wolffd@0: % check training results and select best RBM according to trainign data wolffd@0: % --- wolffd@0: svm_train_performances = [out(:).mean_ok_train]; wolffd@0: [bestTrain, idx] = max(svm_train_performances(1,:)); wolffd@0: result = out(idx); wolffd@0: wolffd@0: % get corresponding test performance wolffd@0: svm_test_performance = result.mean_ok_test(1,:); wolffd@0: fprintf('SVM RBM Test/Train Result=%f / %f\n',svm_test_performance*100,bestTrain*100);