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
5b1ce44b
Commit
5b1ce44b
authored
2 years ago
by
Michele Alberti
Browse files
Options
Downloads
Patches
Plain Diff
[stdlib] Simplify the most to avoid unused stuff.
parent
ede4c07b
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
stdlib/caisar.mlw
+9
-18
9 additions, 18 deletions
stdlib/caisar.mlw
with
9 additions
and
18 deletions
stdlib/caisar.mlw
+
9
−
18
View file @
5b1ce44b
...
...
@@ -27,24 +27,15 @@ theory DatasetClassification
type features = array t
type label_ = int
type datum = (features, label_)
type dataset = {
nb_features: int;
nb_labels: int;
data: array datum
}
type record = (features, label_)
type dataset = array record
constant dataset: dataset
function min_max_scale (clip: bool) (min: t) (max: t) (d: dataset): dataset
function z_norm (mean: t) (std_dev: t) (d: dataset): dataset
type model = {
nb_inputs: int;
nb_outputs: int;
}
type model
function predict: model -> features -> label_
end
...
...
@@ -59,24 +50,24 @@ theory DatasetClassificationProps
a.length = b.length /\
forall i: int. 0 <= i < a.length -> .- eps .< a[i] .- b[i] .< eps
predicate correct_at (m: model) (d:
datum
) =
predicate correct_at (m: model) (d:
record
) =
let (x, y) = d in
y =
predict m x
predict m x
= y
predicate robust_at (m: model) (d:
datum
) (eps: t) =
predicate robust_at (m: model) (d:
record
) (eps: t) =
forall x': features.
let (x, _) = d in
linfty_distance x x' eps ->
predict m x = predict m x'
predicate cond_robust_at (m: model) (d:
datum
) (eps: t) =
predicate cond_robust_at (m: model) (d:
record
) (eps: t) =
correct_at m d /\ robust_at m d eps
predicate correct (m: model) (d: dataset) =
forall i: int. 0 <= i < d.
data.
length -> correct_at m d
.data
[i]
forall i: int. 0 <= i < d.length -> correct_at m d[i]
predicate robust (m: model) (d: dataset) (eps: t) =
forall i: int. 0 <= i < d.
data.
length -> robust_at m d
.data
[i] eps
forall i: int. 0 <= i < d.length -> robust_at m d[i] eps
predicate cond_robust (m: model) (d: dataset) (eps: t) =
correct m d /\ robust m d eps
...
...
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