Skip to content

Commit

Permalink
Merge pull request #206 from mldiego/master
Browse files Browse the repository at this point in the history
Some tests, vnnlib error fix
  • Loading branch information
mldiego authored Jan 11, 2024
2 parents 6670eaa + 044b59a commit 34323a0
Show file tree
Hide file tree
Showing 6 changed files with 664 additions and 4 deletions.
2 changes: 1 addition & 1 deletion code/nnv/engine/nn/funcs/TanSig.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
if ~isa(I, 'Star')
error('Input set is not a star set');
end
if strcmp(method, 'approx-star-no-split') || strcmp(method, 'approx-star')
if strcmp(method, 'approx-star-no-split') || strcmp(method, 'approx-star') || contains(method, 'relax-star')
if relaxFactor == 0
S = TanSig.multiStepTanSig_NoSplit(I, dis_opt, lp_solver);
else
Expand Down
5 changes: 4 additions & 1 deletion code/nnv/engine/utils/export2vnnlib.m
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ function export2vnnlib(lb, ub, outsize, property, name)
% Outputs a string to write in the vnnlib file

locs = find(hRow ~= 0); % Find indexes that are not zero
if hVal == 0 % Compare two indexes
if length(locs) > 1
if hVal ~= 0 % Compare two indexes
error("Only allowed index to index comparison, or 1 index to value, but not both.")
end
if hRow(locs(1)) > 0 %
str = "(>= Y_"+string(locs(2)-1) + " " + "Y_"+string(locs(1)-1)+ "))";
else
Expand Down
2 changes: 1 addition & 1 deletion code/nnv/engine/utils/load_vnnlib.m
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
if contains(x, 'X')
[lb_input, ub_input] = process_input_constraint(x, lb_input, ub_input);
else
[H, g] = process_output_combo_constraint(tline, H, g, output_dim);
[H, g] = process_output_combo_constraint(x, H, g, output_dim);
end
end
Hg = HalfSpace(H,g);
Expand Down
Loading

0 comments on commit 34323a0

Please sign in to comment.