Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lp_nn_robustness_verification
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ludwig10_masters_thesis
lp_nn_robustness_verification
Commits
5bf81bc9
Verified
Commit
5bf81bc9
authored
2 years ago
by
Björn Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
refactor(linear_program): rename theta to theta_is
parent
3e9232c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lp_nn_robustness_verification/linear_program.py
+4
-4
4 additions, 4 deletions
src/lp_nn_robustness_verification/linear_program.py
with
4 additions
and
4 deletions
src/lp_nn_robustness_verification/linear_program.py
+
4
−
4
View file @
5bf81bc9
...
...
@@ -42,7 +42,7 @@ class RobustVerifier:
self
.
_add_objective
()
def
_add_vars_x_i_in_theta_i
(
self
)
->
None
:
for
i_idx
,
theta_i
in
enumerate
(
self
.
linear_inclusion
.
theta
):
for
i_idx
,
theta_i
in
enumerate
(
self
.
linear_inclusion
.
theta
_is
):
for
k_idx
,
theta_i_k
in
enumerate
(
theta_i
):
self
.
x_is
[
i_idx
,
k_idx
]
=
self
.
model
.
addVar
(
name
=
f
"
x_
{
k_idx
}
^(
{
i_idx
}
)
"
,
...
...
@@ -106,11 +106,11 @@ class RobustVerifier:
self
.
linear_inclusion
.
activation
,
self
.
linear_inclusion
.
nn_params
,
)
for
neuron_idx
in
range
(
len
(
self
.
linear_inclusion
.
theta
[
-
1
])):
for
neuron_idx
in
range
(
len
(
self
.
linear_inclusion
.
theta
_is
[
-
1
])):
if
neuron_idx
!=
label
:
self
.
model
.
setObjective
(
self
.
x_is
[
len
(
self
.
linear_inclusion
.
theta
)
-
1
,
label
]
-
self
.
x_is
[
len
(
self
.
linear_inclusion
.
theta
)
-
1
,
neuron_idx
],
self
.
x_is
[
len
(
self
.
linear_inclusion
.
theta
_is
)
-
1
,
label
]
-
self
.
x_is
[
len
(
self
.
linear_inclusion
.
theta
_is
)
-
1
,
neuron_idx
],
"
minimize
"
,
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment