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
e02cfbde
Commit
e02cfbde
authored
1 year ago
by
Aymeric Varasse
Browse files
Options
Downloads
Patches
Plain Diff
[aimos] Make proper `aimos_params` type and use it
parent
463b7da6
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
src/AIMOS.ml
+6
-3
6 additions, 3 deletions
src/AIMOS.ml
src/dataset.ml
+21
-8
21 additions, 8 deletions
src/dataset.ml
src/dataset.mli
+10
-2
10 additions, 2 deletions
src/dataset.mli
with
37 additions
and
13 deletions
src/AIMOS.ml
+
6
−
3
View file @
e02cfbde
...
...
@@ -88,8 +88,11 @@ let build_command config_prover
let
perturbation
,
(
amplitude
:
Dataset
.
amplitude
)
,
perturbation_path
,
out_mode
=
match
predicate
.
property
with
|
Dataset
.
MetaRobust
(
_
,
p
,
ctp
,
om
,
start
,
stop
,
step
)
->
(
p
,
{
start
=
Some
start
;
stop
;
step
=
Some
step
}
,
ctp
,
om
)
|
Dataset
.
MetaRobust
(
_
,
aimos_params
)
->
(
aimos_params
.
perturbation
,
aimos_params
.
amplitude
,
aimos_params
.
ctp
,
aimos_params
.
om
)
|
_
->
failwith
"Unsupported property"
in
let
aimos_config
=
...
...
@@ -104,7 +107,7 @@ let re_aimos_output = Re__Pcre.regexp "((,\\s)(\\d+\\.\\d+))"
let
build_answer
predicate_kind
prover_result
=
let
threshold
=
match
predicate_kind
with
|
Dataset
.
MetaRobust
(
f
,
_
,
_
,
_
,
_
,
_
,
_
)
->
|
Dataset
.
MetaRobust
(
f
,
_
)
->
Float
.
of_string
(
Dataset
.
string_of_threshold
f
)
|
_
->
failwith
"Unsupported property"
in
...
...
This diff is collapsed.
Click to expand it.
src/dataset.ml
+
21
−
8
View file @
e02cfbde
...
...
@@ -56,7 +56,15 @@ type amplitude = {
stop
:
int
;
step
:
int
option
;
}
[
@@
deriving
yojson
]
[
@@
deriving
yojson
,
show
]
type
aimos_params
=
{
perturbation
:
string
;
ctp
:
string
;
om
:
string
;
amplitude
:
amplitude
;
}
[
@@
deriving
yojson
,
show
]
let
string_of_threshold
threshold
=
Float
.
to_string
threshold
...
...
@@ -80,7 +88,7 @@ type property =
|
Correct
|
Robust
of
eps
|
CondRobust
of
eps
|
MetaRobust
of
threshold
*
string
*
string
*
string
*
int
*
int
*
int
|
MetaRobust
of
threshold
*
aimos_params
[
@@
deriving
yojson
,
show
]
type
(
'
a
,
'
b
)
predicate
=
{
...
...
@@ -146,12 +154,17 @@ let interpret_predicate env ~on_model ~on_dataset task =
then
MetaRobust
(
f
,
p
,
ctp
,
om
,
Number
.
to_small_integer
start
,
Number
.
to_small_integer
stop
,
Number
.
to_small_integer
step
)
{
perturbation
=
p
;
ctp
;
om
;
amplitude
=
{
start
=
Some
(
Number
.
to_small_integer
start
);
stop
=
Number
.
to_small_integer
stop
;
step
=
Some
(
Number
.
to_small_integer
step
);
};
}
)
else
failwith_unsupported_ls
ls
|
_
->
failwith_unsupported_term
term
in
...
...
This diff is collapsed.
Click to expand it.
src/dataset.mli
+
10
−
2
View file @
e02cfbde
...
...
@@ -35,7 +35,15 @@ type amplitude = {
stop
:
int
;
step
:
int
option
;
}
[
@@
deriving
yojson
]
[
@@
deriving
yojson
,
show
]
type
aimos_params
=
{
perturbation
:
string
;
ctp
:
string
;
om
:
string
;
amplitude
:
amplitude
;
}
[
@@
deriving
yojson
,
show
]
val
string_of_threshold
:
threshold
->
string
val
string_of_amplitude
:
amplitude
->
string
option
...
...
@@ -44,7 +52,7 @@ type property = private
|
Correct
|
Robust
of
eps
|
CondRobust
of
eps
|
MetaRobust
of
threshold
*
string
*
string
*
string
*
int
*
int
*
int
|
MetaRobust
of
threshold
*
aimos_params
[
@@
deriving
yojson
,
show
]
type
(
'
model
,
'
dataset
)
predicate
=
private
{
...
...
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