changeset 4:a1f6a08f624c tip

Completed version 0.0.2
author Francisco Rodriguez Algarra <f.rodriguezalgarra@qmul.ac.uk>
date Tue, 03 Nov 2015 21:24:41 +0000
parents 06a2a18a3960
children
files README.txt load_files.m reeval/classification/perform_classification.m reeval/experiments/run_experiment.m reeval/features/compute_features.m reeval/features/set_filt1_options.m reeval/features/set_filt2_options.m scatter_reeval.m
diffstat 8 files changed, 40 insertions(+), 27 deletions(-) [+]
line wrap: on
line diff
--- a/README.txt	Wed Oct 28 16:19:45 2015 +0000
+++ b/README.txt	Tue Nov 03 21:24:41 2015 +0000
@@ -26,7 +26,7 @@
 
 It also requires the GTZAN music dataset, available at: http://opihi.cs.uvic.ca/sound/genres.tar.gz
 
-In order to run the experiments, you first need to edit the file "scatter_reeval.m", modifying the values of the variables "scatnet_path", "libsvm_compact_path", and "gtzan_path" to point at the locations of the libraries and the dataset in your own system.
+In order to run the experiments, you first need to edit the file "load_files.m", modifying the values of the variables "scatnet_path", "libsvm_compact_path", and "gtzan_path" to point at the locations of the libraries and the dataset in your own system.
 
 You can also modify the location where the results of the experiments will be stored changing the value of the "results_dir" variable.
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/load_files.m	Tue Nov 03 21:24:41 2015 +0000
@@ -0,0 +1,17 @@
+% Modify the following variables to include the locations 
+% of the libraries and the dataset in your own system
+
+scatnet_path = [pwd, '/../libraries/scatnet-0.2/'];
+libsvm_compact_path = [pwd, '/../libraries/libsvm-compact-0.1/'];
+
+gtzan_path = '/import/c4dm-datasets/gtzan/';
+
+fprintf('\n**********\nAdding the necessary folders to Matlab path\n**********\n');
+run([scatnet_path, 'addpath_scatnet.m']);
+addpath([libsvm_compact_path, 'matlab']);
+
+mfilepath=fileparts(which(mfilename));
+addpath(fullfile(mfilepath,'reeval/experiments/'));
+addpath(fullfile(mfilepath,'reeval/folds/'));
+addpath(fullfile(mfilepath,'reeval/classification/'));
+addpath(fullfile(mfilepath,'reeval/features/'));
--- a/reeval/classification/perform_classification.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/reeval/classification/perform_classification.m	Tue Nov 03 21:24:41 2015 +0000
@@ -1,15 +1,27 @@
 function [results] = perform_classification(experiment, db, condition)
 
   db = svm_calc_kernel(db,'gaussian','square',1:8:size(db.features,2));
+  
 
   optt.kernel_type = 'gaussian';
   optt.C = 2.^[0:4:8];
   optt.gamma = 2.^[-16:4:-8];
   optt.search_depth = 3;
-  optt.full_test_kernel = 1;
+
+  % This causes the accuracy to be lower than it could!
+  switch(experiment)
+    case('time_scat_l3')
+      optt.full_test_kernel = 0;
+    otherwise 
+      optt.full_test_kernel = 1;
+  end  
+
+  %
 
   if nargin < 3
     condition = cellstr(['none '; 'fault']);
+  else
+    condition = cellstr(condition);
   end
 
   for ii=1:length(condition)
--- a/reeval/experiments/run_experiment.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/reeval/experiments/run_experiment.m	Tue Nov 03 21:24:41 2015 +0000
@@ -8,7 +8,7 @@
   end
 
   db = compute_features(experiment);
-
+  
   db.results = perform_classification(experiment, db, condition);
 
   store_results(experiment, db, results_dir);
--- a/reeval/features/compute_features.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/reeval/features/compute_features.m	Tue Nov 03 21:24:41 2015 +0000
@@ -13,8 +13,9 @@
   % extract features using the computed options
 
   features = extract_features(experiment, N, options);
-
+  
   db = prepare_database(src, features);
+  
   db.features = single(db.features);
-
+  
 end
--- a/reeval/features/set_filt1_options.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/reeval/features/set_filt1_options.m	Tue Nov 03 21:24:41 2015 +0000
@@ -7,13 +7,13 @@
         filt1_opt.Q = [8 2];
         filt1_opt.boundary = 'symm';
     case {'time_scat_l1', 'time_scat_l2'}
-        filt1_opt.wavelet_type = {'gabor_1d', 'morlet_1d'};
+        filt1_opt.filter_type = {'gabor_1d', 'morlet_1d'};
         filt1_opt.Q = [8 2];
     case {'time_freq_scat_l2', 'time_freq_scat_l2_adap_q1'}
-        filt1_opt.wavelet_type = {'gabor_1d', 'morlet_1d'};
+        filt1_opt.filter_type = {'gabor_1d', 'morlet_1d'};
         filt1_opt.Q = [8 1];
     case 'time_scat_l3'
-        filt1_opt.wavelet_type = {'gabor_1d', 'morlet_1d', 'morlet_1d'};
+        filt1_opt.filter_type = {'gabor_1d', 'morlet_1d', 'morlet_1d'};
         filt1_opt.Q = [8 2 1];
     otherwise
         error(['Unknown experiment ', experiment, '. Aborting']);
--- a/reeval/features/set_filt2_options.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/reeval/features/set_filt2_options.m	Tue Nov 03 21:24:41 2015 +0000
@@ -8,7 +8,7 @@
     sc2_opt = options.sc1_opt;
 
     ffilt2_opt = options.ffilt1_opt;
-    ffilts2_opt.J = 5;
+    ffilt2_opt.J = 5;
 
     fsc2_opt = options.fsc1_opt;
 
--- a/scatter_reeval.m	Wed Oct 28 16:19:45 2015 +0000
+++ b/scatter_reeval.m	Tue Nov 03 21:24:41 2015 +0000
@@ -1,26 +1,9 @@
-% Modify the following variables to include the locations 
-% of the libraries and the dataset in your own system
 
-scatnet_path = [pwd, '/../libraries/scatnet-0.2/'];
-libsvm_compact_path = [pwd, '/../libraries/libsvm-compact-0.1/'];
-
-gtzan_path = '/import/c4dm-datasets/gtzan/';
+load_files;
 
 global results_dir;
 results_dir = [pwd, '/../results_reeval/'];
 
-%
-
-fprintf('\n**********\nAdding the necessary folders to Matlab path\n**********\n');
-run([scatnet_path, 'addpath_scatnet.m']);
-addpath([libsvm_compact_path, 'matlab']);
-
-mfilepath=fileparts(which(mfilename));
-addpath(fullfile(mfilepath,'reeval/experiments/'));
-addpath(fullfile(mfilepath,'reeval/folds/'));
-addpath(fullfile(mfilepath,'reeval/classification/'));
-addpath(fullfile(mfilepath,'reeval/features/'));
-
 fprintf('\n**********\nSTARTING TO RUN EXPERIMENTS\n**********\n');
 
 global src;