Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
caisar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
caisar
Commits
050e1ceb
Commit
050e1ceb
authored
11 months ago
by
François Bobot
Committed by
Aymeric Varasse
9 months ago
Browse files
Options
Downloads
Patches
Plain Diff
[exps] Add tests for split_nn
parent
c3542bcb
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
examples/mnist/splitted_nn.mlw
+40
-0
40 additions, 0 deletions
examples/mnist/splitted_nn.mlw
tests/dune
+16
-1
16 additions, 1 deletion
tests/dune
tests/splitted_nn.t
+7
-0
7 additions, 0 deletions
tests/splitted_nn.t
with
63 additions
and
1 deletion
examples/mnist/splitted_nn.mlw
0 → 100644
+
40
−
0
View file @
050e1ceb
theory MNIST
use caisar.types.Vector
use ieee_float.Float64
use caisar.types.Float64WithBounds as Feature
use caisar.types.IntWithBounds as Label
use caisar.model.Model
use caisar.dataset.CSV
use caisar.robust.ClassRobustCSV
use caisar.robust.ClassRobustVector
constant pre_model_filename: string
constant post_model_filename: string
constant dataset_filename: string
constant label_bounds: Label.bounds =
Label.{ lower = 0; upper = 9 }
constant feature_bounds: Feature.bounds =
Feature.{ lower = (0.0:t); upper = (1.0:t) }
goal pruned:
let pre_nn = read_model pre_model_filename in
let post_nn = read_model post_model_filename in
let dataset = read_dataset dataset_filename in
let eps = (0.0100000000000000002081668171172168513294309377670288085937500000:t) in
CSV.forall_ dataset (fun l e ->
forall perturbed_e.
has_length perturbed_e (length e) ->
FeatureVector.valid feature_bounds perturbed_e ->
let perturbation = perturbed_e - e in
ClassRobustVector.bounded_by_epsilon perturbation eps ->
let out1 = pre_nn@@perturbed_e in
let out2 = post_nn@@out1 in
forall j. Label.valid label_bounds j -> j <> l ->
out2[l] .>= out2[j]
)
end
This diff is collapsed.
Click to expand it.
tests/dune
+
16
−
1
View file @
050e1ceb
(cram
(alias local)
(applies_to * \ nir_to_onnx acasxu_ci arithmetic check_pruning)
(applies_to * \ nir_to_onnx acasxu_ci arithmetic check_pruning
splited_nn
)
(deps
(package caisar)
setup_env.sh
...
...
@@ -42,6 +42,21 @@
)
(package caisar))
(cram
(alias local)
(applies_to splitted_nn)
(deps
(package caisar)
setup_env.sh
(glob_files bin/*)
filter_tmpdir.sh
../examples/mnist/splitted_nn.mlw
../examples/mnist/nets/dummy_nn/fnn_pre_s42.onnx
../examples/mnist/nets/dummy_nn/fnn_post_s42.onnx
../examples/mnist/csv/single_image.csv
)
(package caisar))
(cram
(alias ci)
...
...
This diff is collapsed.
Click to expand it.
tests/splitted_nn.t
0 → 100644
+
7
−
0
View file @
050e1ceb
$
.
./
setup_env
.
sh
$
ls
..
/examples/
acasxu
mnist
# $ caisar verify --prover PyRAT --ltag=StackTrace --define pre_model_filename:nets/dummy_nn/fnn_pre_s42.onnx --define post_model_filename:nets/dummy_nn/fnn_post_s42.onnx --define dataset_filename:csv/single_image.csv ../examples/mnist/splitted_nn.mlw -v
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