-
Notifications
You must be signed in to change notification settings - Fork 8
/
stream_mod_sulq_mask.m
35 lines (31 loc) · 997 Bytes
/
stream_mod_sulq_mask.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
function [mask] = stream_mod_sulq_mask(dims, c, e_p, delta, scaler)
%STREAM_MOD_SULQ_MASK Generate the perturbation mask for block B.
%
% Function that generates the required perturbation mask per block
% subject to the correct variance (omega). There is also the option to set
% a variance scaler if desired.
%
% Based on work of Grammenos et al.: https://arxiv.org/abs/1907.08059
%
% Author: Andreas Grammenos (ag926@cl.cam.ac.uk)
%
% Last touched date: 19/04/2020
%
% License: GPLv3
%
% ambient dimension (d)
d = dims(1);
% the block size (b)
b = dims(2);
% check if we have a specific variance scaler
if nargin < 5
scaler = 1;
end
% generate the omega variance
% omega = stream_mod_sulq_variance(d, c, e_p, delta, scaler);
omega = stream_mod_sulq_variance(d, c, e_p, delta, scaler);
% omega = mod_sulq_variance(d, c, e_p, delta);
% apply variance to random values
% mask = (scaler * omega) * randn(d, c);
mask = (scaler * omega) * randn(d, b);
end