Skip to content

Commit

Permalink
Fix bug on ImageStar.estimateRanges
Browse files Browse the repository at this point in the history
  • Loading branch information
mldiego committed Aug 28, 2024
1 parent 6e0ff35 commit 13a2fc0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions code/nnv/engine/set/ImageStar.m
Original file line number Diff line number Diff line change
Expand Up @@ -857,10 +857,13 @@

if isempty(obj.im_lb) || isempty(obj.im_ub)

x1 = obj.V(:,:,:,1) + tensorprod(obj.V(:,:,:,2:end), obj.pred_lb, 4, 1);
x2 = obj.V(:,:,:,1) + tensorprod(obj.V(:,:,:,2:end), obj.pred_ub, 4, 1);
image_lb = min(x1,x2);
image_ub = max(x1,x2);
gens = obj.V(:,:,:,2:end);
pos_gens = gens;
pos_gens(gens < 0) = 0;
neg_gens = gens;
neg_gens(gens > 0) = 0;
image_lb = obj.V(:,:,:,1) + tensorprod(pos_gens, obj.pred_lb, 4, 1) + tensorprod(neg_gens, obj.pred_ub, 4, 1);
image_ub = obj.V(:,:,:,1) + tensorprod(pos_gens, obj.pred_ub, 4, 1) + tensorprod(neg_gens, obj.pred_lb, 4, 1);

obj.im_lb = image_lb;
obj.im_ub = image_ub;
Expand Down

0 comments on commit 13a2fc0

Please sign in to comment.