Skip to content

Commit

Permalink
Fix bug causing numerical discrepancies
Browse files Browse the repository at this point in the history
  • Loading branch information
mldiego committed Mar 27, 2024
1 parent 3126ebb commit f07e643
Show file tree
Hide file tree
Showing 5 changed files with 106 additions and 276 deletions.
8 changes: 4 additions & 4 deletions code/nnv/engine/set/ImageStar.m
Original file line number Diff line number Diff line change
Expand Up @@ -668,15 +668,15 @@
S.C = single(S.C);
S.d = single(S.d);
S.pred_lb = single(S.pred_lb);
S.pred_ub = single(S.pred_lb);
S.pred_ub = single(S.pred_ub);
S.im_lb = single(S.im_lb);
S.im_ub = single(S.im_ub);
elseif strcmp(precision, 'double')
S.V = double(S.V);
S.C = double(S.C);
S.d = double(S.d);
S.pred_lb = double(S.pred_lb);
S.pred_ub = double(S.pred_lb);
S.pred_ub = double(S.pred_ub);
S.im_lb = double(S.im_lb);
S.im_ub = double(S.im_ub);
else
Expand All @@ -692,15 +692,15 @@
S.C = gather(S.C);
S.d = gather(S.d);
S.pred_lb = gather(S.pred_lb);
S.pred_ub = gather(S.pred_lb);
S.pred_ub = gather(S.pred_ub);
S.im_lb = gather(S.im_lb);
S.im_ub = gather(S.im_ub);
elseif strcmp(deviceTarget, 'gpu')
S.V = gpuArray(S.V);
S.C = gpuArray(S.C);
S.d = gpuArray(S.d);
S.pred_lb = gpuArray(S.pred_lb);
S.pred_ub = gpuArray(S.pred_lb);
S.pred_ub = gpuArray(S.pred_ub);
S.im_lb = gpuArray(S.im_lb);
S.im_ub = gpuArray(S.im_ub);
else
Expand Down
8 changes: 4 additions & 4 deletions code/nnv/engine/set/Star.m
Original file line number Diff line number Diff line change
Expand Up @@ -1468,15 +1468,15 @@
S.C = single(S.C);
S.d = single(S.d);
S.predicate_lb = single(S.predicate_lb);
S.predicate_ub = single(S.predicate_lb);
S.predicate_ub = single(S.predicate_ub);
S.state_lb = single(S.state_lb);
S.state_ub = single(S.state_ub);
elseif strcmp(precision, 'double')
S.V = double(S.V);
S.C = double(S.C);
S.d = double(S.d);
S.predicate_lb = double(S.predicate_lb);
S.predicate_ub = double(S.predicate_lb);
S.predicate_ub = double(S.predicate_ub);
S.state_lb = double(S.state_lb);
S.state_ub = double(S.state_ub);
else
Expand All @@ -1492,15 +1492,15 @@
S.C = gather(S.C);
S.d = gather(S.d);
S.predicate_lb = gather(S.predicate_lb);
S.predicate_ub = gather(S.predicate_lb);
S.predicate_ub = gather(S.predicate_ub);
S.state_lb = gather(S.state_lb);
S.state_ub = gather(S.state_ub);
elseif strcmp(deviceTarget, 'gpu')
S.V = gpuArray(S.V);
S.C = gpuArray(S.C);
S.d = gpuArray(S.d);
S.predicate_lb = gpuArray(S.predicate_lb);
S.predicate_ub = gpuArray(S.predicate_lb);
S.predicate_ub = gpuArray(S.predicate_ub);
S.state_lb = gpuArray(S.state_lb);
S.state_ub = gpuArray(S.state_ub);
else
Expand Down
8 changes: 4 additions & 4 deletions code/nnv/engine/set/VolumeStar.m
Original file line number Diff line number Diff line change
Expand Up @@ -531,15 +531,15 @@
S.C = single(S.C);
S.d = single(S.d);
S.pred_lb = single(S.pred_lb);
S.pred_ub = single(S.pred_lb);
S.pred_ub = single(S.pred_ub);
S.vol_lb = single(S.vol_lb);
S.vol_ub = single(S.vol_ub);
elseif strcmp(precision, 'double')
S.V = double(S.V);
S.C = double(S.C);
S.d = double(S.d);
S.pred_lb = double(S.pred_lb);
S.pred_ub = double(S.pred_lb);
S.pred_ub = double(S.pred_ub);
S.vol_lb = double(S.vol_lb);
S.vol_ub = double(S.vol_ub);
else
Expand All @@ -555,15 +555,15 @@
S.C = gather(S.C);
S.d = gather(S.d);
S.predicate_lb = gather(S.predicate_lb);
S.predicate_ub = gather(S.predicate_lb);
S.predicate_ub = gather(S.predicate_ub);
S.vol_lb = gather(S.vol_lb);
S.vol_ub = gather(S.vol_ub);
elseif strcmp(deviceTarget, 'gpu')
S.V = gpuArray(S.V);
S.C = gpuArray(S.C);
S.d = gpuArray(S.d);
S.predicate_lb = gpuArray(S.predicate_lb);
S.predicate_ub = gpuArray(S.predicate_lb);
S.predicate_ub = gpuArray(S.predicate_ub);
S.vol_lb = gpuArray(S.vol_lb);
S.vol_ub = gpuArray(S.vol_ub);
else
Expand Down
224 changes: 0 additions & 224 deletions code/nnv/examples/other/numerical_discrepancies.m

This file was deleted.

Loading

0 comments on commit f07e643

Please sign in to comment.