-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #232 from mldiego/master
Fix bug checkRobust
- Loading branch information
Showing
9 changed files
with
123 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
function counterExamples = getCounterRegion(inputSet, unsafeRegion, reachSet) | ||
% counterExamples = getCounterRegion(inputSet, unsafeRegion, reachSet) | ||
% NOTE: This is only to be used with exact-star method | ||
% unsafeRegion = HalfSpace (unsafe/undesired region) | ||
% inputSet = ImageStar/Star | ||
% reachSet = Star | ||
% | ||
% check the "safety" of the reachSet | ||
% Then, generate counterexamples | ||
|
||
% Initialize variables | ||
counterExamples = []; | ||
|
||
% Get halfspace variables | ||
G = unsafeRegion.G; | ||
g = unsafeRegion.g; | ||
|
||
% Check for valid inputs | ||
if ~isa(inputSet, "Star") | ||
error("Must be a Star"); | ||
end | ||
if ~isa(reachSet, "Star") | ||
error("Must be Star or ImageStar"); | ||
end | ||
|
||
% Begin counterexample computation | ||
n = length(reachSet); % number of stars in the output set | ||
V = inputSet.V; | ||
for i=1:n | ||
% Check for safety, if unsafe, add to counter | ||
if ~isempty(reachSet(i).intersectHalfSpace(G, g)) | ||
counterExamples = [counterExamples Star(V, reachSet(i).C, reachSet(i).d,... | ||
reachSet(i).predicate_lb, reachSet(i).predicate_ub)]; | ||
end | ||
end | ||
|
||
end | ||
|
1 change: 0 additions & 1 deletion
1
code/nnv/examples/Submission/VNN_COMP2024/results_approx_tinyimagenet/instance_1.txt
This file was deleted.
Oops, something went wrong.