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
b210db29
Commit
b210db29
authored
1 year ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[examples] Update mnist specification.
parent
a69f2cb3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
examples/mnist/mnist.why
+19
-0
19 additions, 0 deletions
examples/mnist/mnist.why
examples/mnist/property.why
+0
-39
0 additions, 39 deletions
examples/mnist/property.why
with
19 additions
and
39 deletions
examples/mnist/mnist.why
0 → 100644
+
19
−
0
View file @
b210db29
theory MNIST
use ieee_float.Float64
use int.Int
use nn.NeuralNetwork
use dataset.DatasetCSV
use robust.RobustDatasetCSV
constant min_label : label_ = 0
constant max_label : label_ = 9
predicate valid_label (l: label_) =
RobustDatasetCSV.valid_label min_label max_label l
goal robustness:
let nn = read_neural_network "nets/MNIST_256_2.onnx" ONNX in
let dataset = read_dataset_csv "csv/mnist_test.csv" in
let eps = (0.0100000000000000002081668171172168513294309377670288085937500000:t) in
robust valid_label nn dataset eps
end
This diff is collapsed.
Click to expand it.
examples/mnist/property.why
deleted
100644 → 0
+
0
−
39
View file @
a69f2cb3
theory MNIST
use ieee_float.Float64
use int.Int
use interpretation.Vector
use interpretation.NeuralNetwork
use interpretation.Dataset
type image = vector t
type label_ = int
predicate valid_image (i: image) =
forall v: index. valid_index i v -> (0.0: t) .<= i[v] .<= (1.0: t)
predicate valid_label (l: label_) = 0 <= l <= 9
predicate advises (n: nn) (i: image) (l: label_) =
valid_label l ->
forall j: int. valid_label j -> j <> l -> (n@@i)[l] .> (n@@i)[j]
predicate bounded_by_epsilon (i: image) (eps: t) =
forall v: index. valid_index i v -> .- eps .<= i[v] .<= eps
predicate robust_around (n: nn) (eps: t) (l: label_) (i: image) =
forall perturbed_image: image.
has_length perturbed_image (length i) ->
valid_image perturbed_image ->
let perturbation = perturbed_image - i in
bounded_by_epsilon perturbation eps ->
advises n perturbed_image l
predicate robust (n: nn) (d: dataset label_ image) (eps: t) =
Dataset.forall_ d (robust_around n eps)
goal robustness:
let nn = read_neural_network "nets/MNIST_256_2.onnx" ONNX in
let dataset = read_dataset "csv/mnist_test.csv" CSV in
let eps = (0.0100000000000000002081668171172168513294309377670288085937500000:t) in
robust nn dataset eps
end
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