From 04c940d371fdcf80cb0e70fa774c14940e77c6b5 Mon Sep 17 00:00:00 2001 From: Haifeng Date: Fri, 16 Dec 2016 16:39:55 +0800 Subject: [PATCH 1/2] a a --- MATLAB/metrics.m | 1 + MATLAB/setup_new.m | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 MATLAB/setup_new.m diff --git a/MATLAB/metrics.m b/MATLAB/metrics.m index 0afc70d..9c53996 100644 --- a/MATLAB/metrics.m +++ b/MATLAB/metrics.m @@ -5,6 +5,7 @@ % Example: metrics('ap@k', actual, predicted, k) % % Author: Ben Hamner (ben@benhamner.com) +% add one test from haifeng switch lower(metric_name) case 'ae' diff --git a/MATLAB/setup_new.m b/MATLAB/setup_new.m new file mode 100644 index 0000000..cd3b3ed --- /dev/null +++ b/MATLAB/setup_new.m @@ -0,0 +1,32 @@ +function setup +%SETUP Adds directories for Metrics to your MATLAB path +% +% Author: Ben Hamner (ben@benhamner.com) + +myDir = fileparts(mfilename('fullpath')); +paths = genpath(myDir); +paths = strread(paths,'%s','delimiter',':'); +pathsToAdd = []; + +for i=1:length(paths) + thisPath = paths{i}; + thisPathSplit = strread(thisPath,'%s','delimiter','/'); + addThisPath = 1; + + % Do not add any directories or files starting with a . or a ~ + for j=1:length(thisPathSplit) + thisStr = thisPathSplit{j}; + if (~isempty(thisStr)) && ((thisStr(1) == '.') || (thisStr(1) == '~')) + addThisPath = 0; + end + end + if addThisPath ==1 + if ~isempty(pathsToAdd) + thisPath = [':' thisPath]; + end + pathsToAdd = [pathsToAdd thisPath]; + end +end + +addpath(pathsToAdd); +savepath; From 9bf24574f339f4083ab800cea20625c18d9cbb72 Mon Sep 17 00:00:00 2001 From: Haifeng Date: Fri, 16 Dec 2016 16:41:31 +0800 Subject: [PATCH 2/2] Revert "a" This reverts commit 04c940d371fdcf80cb0e70fa774c14940e77c6b5. --- MATLAB/metrics.m | 1 - MATLAB/setup_new.m | 32 -------------------------------- 2 files changed, 33 deletions(-) delete mode 100644 MATLAB/setup_new.m diff --git a/MATLAB/metrics.m b/MATLAB/metrics.m index 9c53996..0afc70d 100644 --- a/MATLAB/metrics.m +++ b/MATLAB/metrics.m @@ -5,7 +5,6 @@ % Example: metrics('ap@k', actual, predicted, k) % % Author: Ben Hamner (ben@benhamner.com) -% add one test from haifeng switch lower(metric_name) case 'ae' diff --git a/MATLAB/setup_new.m b/MATLAB/setup_new.m deleted file mode 100644 index cd3b3ed..0000000 --- a/MATLAB/setup_new.m +++ /dev/null @@ -1,32 +0,0 @@ -function setup -%SETUP Adds directories for Metrics to your MATLAB path -% -% Author: Ben Hamner (ben@benhamner.com) - -myDir = fileparts(mfilename('fullpath')); -paths = genpath(myDir); -paths = strread(paths,'%s','delimiter',':'); -pathsToAdd = []; - -for i=1:length(paths) - thisPath = paths{i}; - thisPathSplit = strread(thisPath,'%s','delimiter','/'); - addThisPath = 1; - - % Do not add any directories or files starting with a . or a ~ - for j=1:length(thisPathSplit) - thisStr = thisPathSplit{j}; - if (~isempty(thisStr)) && ((thisStr(1) == '.') || (thisStr(1) == '~')) - addThisPath = 0; - end - end - if addThisPath ==1 - if ~isempty(pathsToAdd) - thisPath = [':' thisPath]; - end - pathsToAdd = [pathsToAdd thisPath]; - end -end - -addpath(pathsToAdd); -savepath;