Skip to content

Commit

Permalink
241013.000311.CST use mixed noise instead of mulplicative noise in th…
Browse files Browse the repository at this point in the history
…e profiles
  • Loading branch information
zaikunzhang committed Oct 12, 2024
1 parent 3867000 commit a3715fe
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions matlab/tests/private/testcu.m
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@
case {'absolute', 'additive', 'add', 'a', '+'}
f = f + noise.level*r;
otherwise
f = f * (1 + noise.level*r);
%f = f * (1 + noise.level*r);
f = f + max(abs(f), 1)*noise.level*r; % abs(f) is reasonable because the distribution of r is symmetric w.r.t. 0.
end
end
end
Expand All @@ -829,7 +830,8 @@
case {'absolute', 'additive', 'add', 'a', '+'}
f = f + dnoise.level*r;
otherwise
f = f * (1 + dnoise.level*r);
%f = f * (1 + dnoise.level*r);
f = f + max(abs(f), 1)*dnoise.level*r;
end
end
end
Expand Down Expand Up @@ -1063,7 +1065,7 @@
'OET6', ...
'OET7', ...
'QINGNE', ...
'QPCBLEND' , ...
'QPCBLEND', ...
'SPANHYD', ... % 15
'SWOPF', ... % 10
'TAX13322', ... % 5
Expand Down
4 changes: 2 additions & 2 deletions matlab/tests/profile.m
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
if isfield(options, 'eval_options') && isstruct(options.eval_options) && ~isempty(fieldnames(options.eval_options))
test_feature = [test_feature, '.', strjoin(fieldnames(options.eval_options), '_')];
if isfield(options.eval_options, 'dnoise')
if isnumeric(options.eval_options.dnoise) && isscalar(options.eval_options)
if isnumeric(options.eval_options.dnoise) && isscalar(options.eval_options.dnoise)
dnoise_level = abs(options.eval_options.dnoise);
elseif isstruct(options.eval_options.dnoise) && isfield(options.eval_options.dnoise, 'level')
dnoise_level = abs(options.eval_options.dnoise.level);
Expand All @@ -103,7 +103,7 @@
end
end
if isfield(options.eval_options, 'noise')
if isnumeric(options.eval_options.noise) && isscalar(options.eval_options)
if isnumeric(options.eval_options.noise) && isscalar(options.eval_options.noise)
noise_level = abs(options.eval_options.noise);
elseif isstruct(options.eval_options.noise) && isfield(options.eval_options.noise, 'level')
noise_level = abs(options.eval_options.noise.level);
Expand Down

0 comments on commit a3715fe

Please sign in to comment.