time | Calls | line |
---|
| | 93 | function batch_idx = assign_inst_idx(GNsize, l)
|
| | 94 |
|
< 0.001 | 1 | 95 | num_splits = ceil(l/GNsize);
|
0.004 | 1 | 96 | perm_idx = randperm(l);
|
| | 97 | % ensure each subsampled Hessian has the same size
|
< 0.001 | 1 | 98 | perm_idx = [perm_idx perm_idx(1:GNsize)];
|
< 0.001 | 1 | 99 | batch_idx = cell(num_splits,1);
|
| | 100 |
|
< 0.001 | 1 | 101 | for i = 1 : num_splits
|
| | 102 | % random selection instead of random split
|
| | 103 | % batch_idx{i} = randperm(l, GNsize);
|
< 0.001 | 20 | 104 | batch_idx{i} = perm_idx((i-1)*GNsize+1 : i*GNsize);
|
< 0.001 | 20 | 105 | end
|
Other subfunctions in this file are not included in this listing.