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
52f5dc6d
Commit
52f5dc6d
authored
1 year ago
by
Aymeric Varasse
Browse files
Options
Downloads
Patches
Plain Diff
[records] Make AIMOS amplitude type optional
parent
dc0c17ec
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
src/dataset.ml
+13
-19
13 additions, 19 deletions
src/dataset.ml
src/dataset.mli
+5
-3
5 additions, 3 deletions
src/dataset.mli
with
18 additions
and
22 deletions
src/dataset.ml
+
13
−
19
View file @
52f5dc6d
...
@@ -51,13 +51,15 @@ let term_of_eps env eps =
...
@@ -51,13 +51,15 @@ let term_of_eps env eps =
type
threshold
=
float
[
@@
deriving
yojson
,
show
]
type
threshold
=
float
[
@@
deriving
yojson
,
show
]
type
amplitude
=
{
type
amplitude
_record
=
{
start
:
int
option
;
start
:
int
;
stop
:
int
;
stop
:
int
;
step
:
int
option
;
step
:
int
;
}
}
[
@@
deriving
yojson
,
show
]
[
@@
deriving
yojson
,
show
]
type
amplitude
=
amplitude_record
option
[
@@
deriving
yojson
,
show
]
type
aimos_params
=
{
type
aimos_params
=
{
perturbation
:
string
;
perturbation
:
string
;
ctp
:
string
;
ctp
:
string
;
...
@@ -69,20 +71,12 @@ type aimos_params = {
...
@@ -69,20 +71,12 @@ type aimos_params = {
let
string_of_threshold
threshold
=
Float
.
to_string
threshold
let
string_of_threshold
threshold
=
Float
.
to_string
threshold
let
string_of_amplitude
amplitude
=
let
string_of_amplitude
amplitude
=
let
start
=
match
amplitude
.
start
with
Some
a
->
a
|
None
->
0
in
match
amplitude
with
if
start
=
amplitude
.
stop
|
Some
a
->
then
None
else
let
start_str
=
Option
.
value_map
amplitude
.
start
~
default
:
""
~
f
:
Int
.
to_string
in
let
step_str
=
Option
.
value_map
amplitude
.
step
~
default
:
""
~
f
:
Int
.
to_string
in
Some
Some
(
Fmt
.
str
"range(%s, %s, %s)"
start_str
(
Fmt
.
str
"range(%s, %s, %s)"
(
Int
.
to_string
a
.
start
)
(
Int
.
to_string
a
mplitude
.
sto
p
)
(
Int
.
to_string
a
.
stop
)
(
Int
.
to_string
a
.
ste
p
)
)
step_str
)
|
None
->
None
type
property
=
type
property
=
|
Correct
|
Correct
...
@@ -158,10 +152,10 @@ let interpret_predicate env ~on_model ~on_dataset task =
...
@@ -158,10 +152,10 @@ let interpret_predicate env ~on_model ~on_dataset task =
ctp
;
ctp
;
om
;
om
;
amplitude
=
amplitude
=
{
Some
{
start
=
Some
(
Number
.
to_small_integer
start
)
;
start
=
Number
.
to_small_integer
start
;
stop
=
Number
.
to_small_integer
stop
;
stop
=
Number
.
to_small_integer
stop
;
step
=
Some
(
Number
.
to_small_integer
step
)
;
step
=
Number
.
to_small_integer
step
;
};
};
}
)
}
)
else
failwith_unsupported_ls
ls
else
failwith_unsupported_ls
ls
...
...
This diff is collapsed.
Click to expand it.
src/dataset.mli
+
5
−
3
View file @
52f5dc6d
...
@@ -30,13 +30,15 @@ val term_of_eps : Env.env -> eps -> Term.term
...
@@ -30,13 +30,15 @@ val term_of_eps : Env.env -> eps -> Term.term
type
threshold
[
@@
deriving
yojson
,
show
]
type
threshold
[
@@
deriving
yojson
,
show
]
type
amplitude
=
{
type
amplitude
_record
=
{
start
:
int
option
;
start
:
int
;
stop
:
int
;
stop
:
int
;
step
:
int
option
;
step
:
int
;
}
}
[
@@
deriving
yojson
,
show
]
[
@@
deriving
yojson
,
show
]
type
amplitude
=
amplitude_record
option
[
@@
deriving
yojson
,
show
]
type
aimos_params
=
{
type
aimos_params
=
{
perturbation
:
string
;
perturbation
:
string
;
ctp
:
string
;
ctp
:
string
;
...
...
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