-
Notifications
You must be signed in to change notification settings - Fork 0
/
HDMUnitTangentBundleDemo.m
executable file
·67 lines (59 loc) · 1.44 KB
/
HDMUnitTangentBundleDemo.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% Generate N points uniformly on a sphere in Dim dimensions %%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% load path
clear vars;
path(pathdef);
path(path, genpath('./utils/'));
%% parameters
Dim = 3; %% Dim = 2 or 3
N = 2000;
noise_level = 0;
rng('shuffle');
%%% SPHERE
x = randn(Dim, N);
norm_x = sqrt(sum(x.^2));
x = x * diag(1./norm_x);
%%% visualize
if Dim==3
plot3(x(1,:), x(2,:), x(3,:), '.');
else
plot3(x(1,:), x(2,:), zeros(1,N), '.');
end
axis equal;
title('Original Data Set');
set(gca, 'FontSize', 8);
cameratoolbar;
cameratoolbar('SetCoordSys','none');
%% vector diffusion map
% vdm.data = x;
% vdm.epsilon = 1;
% vdm.NN = 100;
% vdm.T = 2;
% vdm.delta = 0.9;
% vdm.fontsize = 8;
% vdm.symmetrize = 0;
% vdm.Nabla2 = 1;
% vdm.debug = 1;
% vdm.embedmaxdim = 100;
%
% vdm.lambdaNO = vdm.embedmaxdim; %% compatibility issue with H.-T. Wu's original implementation
%
% [rslt] = VecDiffMap(vdm);
%% hypoelliptic diffusion map
hdm.data = x;
hdm.NF = 10;
hdm.BEpsilon = 0.2;
hdm.FEpsilon = 0.02;
hdm.BNN = 100;
hdm.FNN = 10;
hdm.T = 1;
hdm.delta = 0.9;
hdm.embedmaxdim = 100;
hdm.symmetrize = 1;
hdm.FSampleType = 'uniform';
hdm.debug = 1;
hdm.fontsize = 8;
[rslt] = HypoellipticDiffusionMap(hdm);
% hdm.NF = 1;
% [rslt2] = HypoellipticDiffusionMap(hdm);