-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdemo_toy.m
28 lines (23 loc) · 850 Bytes
/
demo_toy.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
% This demo shows WSE optimization process as Fig 2 in [1].
%
% Please feel free to contact me regarding bugs and suggestions.
%
% Contact: Kaili Zhao (kailizhao@bupt.edu.cn)
% Paper: http://openaccess.thecvf.com/content_cvpr_2018/CameraReady/0237.pdf
% Reference:
% [1] "Learning Facial Action Units from Web Images with Scalable Weakly
% Supervised Cluster, " in CVPR 2018.
clc; clear all; addpaths;
%% Data preparation
% Get data
dataset = 'toy';
[feat, label, wlbl] = get_data(dataset);
% Get graph in adjanceny matrix A
A = get_graph( ...
feat, dataset, 'graph_type', 'mutual_knn', ...
'nn_opt', 'pdist', 'num_nn', 100);
%% Run WSE
config = get_config('wse', 'toy');
[clusters, W, obj] = scalable_wse(A, wlbl, config);
%% Display WSE distribution at different iterations
plot_toy_example(obj, clusters, feat, label, wlbl);