-
Notifications
You must be signed in to change notification settings - Fork 1
/
my_grouse.m
48 lines (40 loc) · 1.15 KB
/
my_grouse.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
function [ T, Err, Usg, Vsg, t ] = my_grouse(Y, r, no_err, ...
max_rank, max_cycles, step_size)
%MY_GROUSE This is a essentially a wrapper function which calls GROUSE
% (https://arxiv.org/pdf/1702.01005.pdf) with the specified parameters
%
% Author: Andreas Grammenos ([email protected])
%
% Last touched date: 30/12/2018
%
% License: GPLv3
%
fprintf('\n ** Running GROUSE...');
% default is, no error flag disabled
if nargin < 3
no_err = 0;
end
% default is maxRank = r
if nargin < 4
max_rank = r;
end
% default is maxCycles = 1
if nargin < 5
max_cycles = 1;
end
% default is stepSize = 2 (in original code = 0.1)
if nargin < 6
step_size = 2;
end
% Number of rows and columns
[numr, numc] = size(Y);
% grouse params
en_sparse = 0; % don't use sparse matrices
rperm = 0; % enable/disable random column permutation
% run grouse
ts = tic;
[Usg, Vsg, ~, T, Err] = grouse(1, 1, Y, numr, numc, max_rank, ...
step_size, max_cycles, en_sparse, rperm, no_err);
t = my_toc(ts); % current trial execution time
fprintf("\n");
end