-
Notifications
You must be signed in to change notification settings - Fork 0
/
Figure3.m
66 lines (45 loc) · 1.36 KB
/
Figure3.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
clear all
close all
clc
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% This routine reproduces the results of Figure 3
%
% Stanley Chan
% Harvard University
% Dec 28, 2013
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%========= Load Package ===========%
addpath(genpath('./deconvtv_v1/'));
%========= Experiment Setup =======%
n = 1000; % Number of nodes
caseid = 1; % Graphon ID
wtrue = gen_graphon(n,caseid); % Generate a graphon
G = construct_a_graph_from_P(wtrue,n,1); % Sample a random graph
pidx = randperm(n); % Randomly permute col/row
G = G(pidx,pidx);
%========= Sort and Smooth (Proposed) ====%
t0 = tic;
wsas = sort_and_smooth(G);
t_sas = toc(t0);
%========= USVT (Chatterjee 2012) ========%
t1 = tic;
wusvt = usvt(G);
t_usvt = toc(t1);
%========= SBA (Airoldi et al. 2013) =====%
t2 = tic;
h_opt = oracle_h(G,wtrue);
wsba = stochastic_block(G,h_opt);
t_sba = toc(t2);
%========= Display Result =====%
Fig = figure(1);
imagesc(wtrue); axis image; axis off;
export_fig wtrue_1.eps -transparent
Fig = figure(2);
imagesc(wsas); axis image; axis off;
export_fig wsas_1.eps -transparent
Fig = figure(3);
imagesc(wusvt); axis image; axis off;
export_fig wusvt_1.eps -transparent
Fig = figure(4);
imagesc(wsba); axis image; axis off;
export_fig wsba_1.eps -transparent