diff core/magnatagatune/tests_evals/rbm_subspace/conv_subspace_delta.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/core/magnatagatune/tests_evals/rbm_subspace/conv_subspace_delta.m	Tue Feb 10 15:05:51 2015 +0000
@@ -0,0 +1,25 @@
+function out = conv_subspace_delta(a, b, w, norm)
+% out = conv_subspace_delta(a, b, w, norm)
+% compute the distance vector from 2 vectors a,b using convolution euclidean         %
+% w = convolution window 
+%
+% DW adapted from sontran2013
+
+% window for convolution
+
+s_len = numel(a);
+if w == 0
+    w = s_len;
+end
+cv_vec = ones(w,1);
+
+out = sqrt(conv(cv_vec,(a - b).^2));
+% out = out(:,w:end-w);
+if norm 
+  out = out./(conv(cv_vec,ones(s_len,1)));
+end
+
+% how to get to 1 dimension?
+% out = sum(out);
+
+