Skip to content

Commit 04697e2

Browse files
authored
Add files via upload
1 parent 77e6c0b commit 04697e2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+5278
-0
lines changed
1000 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
function [ dist ] = AvgDistance( x )
2+
%Returns euclidean distance between X and m
3+
4+
dist = sum(sum(x))/length(x);
5+
6+
end
7+
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
function [ distance ] = DTWDistance(data1,tdata1)
2+
%Returns DTW Distance between two sequence
3+
4+
DTW = zeros(length(data1)+1,length(tdata1)+1);
5+
DTW(1,:) = Inf;
6+
DTW(:,1) = Inf;
7+
DTW(1,1) = 0;
8+
9+
for i = 2:length(data1)+1
10+
for j = 2:length(tdata1)+1
11+
cost = myeuclideanDistance(data1(i-1,:),tdata1(j-1,:));
12+
min1 = min(DTW(i-1,j),DTW(i,j-1));
13+
min2 = min(min1,DTW(i-1,j-1));
14+
DTW(i,j) = cost + min2;
15+
end
16+
end
17+
18+
distance = DTW(length(data1)+1,length(tdata1)+1);
19+
20+
21+
end
22+
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
%addpath(genpath('/Users/NiravMBA/Desktop/IIT Madras/Semester I/Pattern Recognition/Assignment/Assignment 4/DTW/bosaris_toolkit'))
2+
3+
function [] = demo_main(test_data,type)
4+
%,target1,nontarget1,target2,nontarget2,target3,nontarget3,target4,nontarget4,target5,nontarget5,caseno)
5+
% To plot DET Curve
6+
7+
close all;
8+
9+
fprintf('You need to run this script in Matlab''s graphical mode to see the plots.\n');
10+
11+
% calculate an effective prior from target prior, Cmiss, and Cfa
12+
prior = effective_prior(0.33,1,1);
13+
14+
15+
%% Assign Target and Non Target Scores
16+
17+
18+
% test_data.tar1 = target;
19+
% test_data.non1 = nontarget;
20+
21+
% test_data.tar2 = target1;
22+
% test_data.non2 = nontarget1;
23+
%
24+
% test_data.tar3 = target2;
25+
% test_data.non3 = nontarget2;
26+
%
27+
% test_data.tar4 = target3;
28+
% test_data.non4 = nontarget3;
29+
%
30+
% test_data.tar5 = target4;
31+
% test_data.non5 = nontarget4;
32+
%
33+
% test_data.tar6 = target5;
34+
% test_data.non6 = nontarget5;
35+
36+
%% make a DET plot for all the five cases.
37+
demo_plot_det_for_fusion(test_data,prior,type);
38+
39+
end

0 commit comments

Comments
 (0)