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
c7926cbe
Verified
Commit
c7926cbe
authored
2 years ago
by
Björn Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
feat(pre_processing): utilize timing module in pre-processing
parent
dddd24d1
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/pre_processing.py
+33
-0
33 additions, 0 deletions
src/lp_nn_robustness_verification/pre_processing.py
with
33 additions
and
0 deletions
src/lp_nn_robustness_verification/pre_processing.py
+
33
−
0
View file @
c7926cbe
...
...
@@ -17,6 +17,7 @@ from lp_nn_robustness_verification.data_types import (
NNParams
,
VectorOfRealVectors
,
)
from
lp_nn_robustness_verification.timing
import
write_current_timing_stats
@dataclass
...
...
@@ -83,6 +84,14 @@ class LinearInclusion:
for
j_idx
,
weight
in
enumerate
(
weight_vector
):
z_i
[
k_idx
]
+=
float
(
weight
)
*
theta_is
[
-
1
][
j_idx
]
z_is
.
append
(
Intervals
(
z_i
))
write_current_timing_stats
(
f
"
{
len
(
self
.
uncertain_inputs
.
values
)
}
_inputs_and
"
f
"
_
{
len
(
self
.
nn_params
.
weights
)
}
_layers_with_sample_
"
f
"
0_and_seed_0_
"
f
"
timings.txt
"
,
f
"
z^(
{
len
(
z_is
)
}
) computation finished
"
,
"
a
"
,
)
theta_i
=
[]
for
z_k
in
z_is
[
-
1
]:
theta_i
.
append
(
...
...
@@ -100,6 +109,14 @@ class LinearInclusion:
theta_i
,
)
)
write_current_timing_stats
(
f
"
{
len
(
self
.
uncertain_inputs
.
values
)
}
_inputs_and
"
f
"
_
{
len
(
self
.
nn_params
.
weights
)
}
_layers_with_sample_
"
f
"
0_and_seed_0_
"
f
"
timings.txt
"
,
f
"
theta^(
{
len
(
z_is
)
}
) computation finished
"
,
"
a
"
,
)
self
.
z_is
=
IntervalCollection
(
z_is
,
)
...
...
@@ -118,6 +135,14 @@ class LinearInclusion:
for
z_k
in
z_i
:
xi_ks
.
append
(
z_k
.
midpoint
[
0
].
inf
)
xi_is
.
append
(
np
.
array
(
xi_ks
))
write_current_timing_stats
(
f
"
{
len
(
self
.
uncertain_inputs
.
values
)
}
_inputs_and
"
f
"
_
{
len
(
self
.
nn_params
.
weights
)
}
_layers_with_sample_
"
f
"
0_and_seed_0_
"
f
"
timings.txt
"
,
f
"
xi^(
{
len
(
xi_is
)
}
) computation finished
"
,
"
a
"
,
)
assert
len
(
xi_ks
)
==
len
(
z_i
),
(
f
"
Somehow there is not one xi_k^(i) for every of the
{
len
(
z_i
)
}
,
"
f
"
z_k^(i), but only
{
len
(
xi_ks
)
}
"
...
...
@@ -146,6 +171,14 @@ class LinearInclusion:
r_i
,
)
)
write_current_timing_stats
(
f
"
{
len
(
self
.
uncertain_inputs
.
values
)
}
_inputs_and
"
f
"
_
{
len
(
self
.
nn_params
.
weights
)
}
_layers_with_sample_
"
f
"
0_and_seed_0_
"
f
"
timings.txt
"
,
f
"
r^(
{
len
(
r_is
)
}
) computation finished
"
,
"
a
"
,
)
self
.
r_is
=
IntervalCollection
(
r_is
)
def
_taylors_residual
(
self
,
xi_k
:
float
,
z_k
:
interval
)
->
interval
:
...
...
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