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
66aceeb9
Commit
66aceeb9
authored
1 year ago
by
François Bobot
Browse files
Options
Downloads
Patches
Plain Diff
[NN_prover] Some documentation
parent
e2cd720a
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
src/transformations/native_nn_prover.ml
+5
-5
5 additions, 5 deletions
src/transformations/native_nn_prover.ml
with
5 additions
and
5 deletions
src/transformations/native_nn_prover.ml
+
5
−
5
View file @
66aceeb9
...
@@ -29,11 +29,6 @@ type new_output = {
...
@@ -29,11 +29,6 @@ type new_output = {
term
:
Why3
.
Term
.
term
;
term
:
Why3
.
Term
.
term
;
}
}
(** invariant:
- input_vars from 0 to its length - 1
- outputs from length - 1 to 0 *)
exception
UnknownLogicSymbol
exception
UnknownLogicSymbol
let
create_new_nn
env
input_vars
outputs
:
string
=
let
create_new_nn
env
input_vars
outputs
:
string
=
...
@@ -51,6 +46,8 @@ let create_new_nn env input_vars outputs : string =
...
@@ -51,6 +46,8 @@ let create_new_nn env input_vars outputs : string =
Ir
.
Nier_simple
.
Node
.
gather_int
input
i
)
Ir
.
Nier_simple
.
Node
.
gather_int
input
i
)
in
in
let
cache
=
Why3
.
Term
.
Hterm
.
create
17
in
let
cache
=
Why3
.
Term
.
Hterm
.
create
17
in
(* Instantiate the input of [old_nn] with the [old_nn_args] terms transformed
into node *)
let
rec
convert_old_nn
(
old_nn
:
Language
.
nn
)
old_index
old_nn_args
:
let
rec
convert_old_nn
(
old_nn
:
Language
.
nn
)
old_index
old_nn_args
:
IR
.
GFloat
.
Node
.
t
=
IR
.
GFloat
.
Node
.
t
=
let
old_index
=
Why3
.
Number
.
to_small_integer
old_index
in
let
old_index
=
Why3
.
Number
.
to_small_integer
old_index
in
...
@@ -64,7 +61,9 @@ let create_new_nn env input_vars outputs : string =
...
@@ -64,7 +61,9 @@ let create_new_nn env input_vars outputs : string =
m
"No parsed NN for '%s': %s"
old_nn
.
nn_filename
s
)
m
"No parsed NN for '%s': %s"
old_nn
.
nn_filename
s
)
|
Ok
{
nier
=
Ok
g
;
_
}
->
g
|
Ok
{
nier
=
Ok
g
;
_
}
->
g
in
in
(* Create the graph to replace the old input of the nn *)
let
input
()
=
let
input
()
=
(* Regroup the terms into one node *)
let
node
=
let
node
=
IR
.
Node
.
create
IR
.
Node
.
create
(
Concat
{
inputs
=
List
.
map
~
f
:
convert_term
old_nn_args
;
axis
=
0
})
(
Concat
{
inputs
=
List
.
map
~
f
:
convert_term
old_nn_args
;
axis
=
0
})
...
@@ -190,6 +189,7 @@ let create_new_nn env input_vars outputs : string =
...
@@ -190,6 +189,7 @@ let create_new_nn env input_vars outputs : string =
Onnx
.
Simple
.
write
nn
filename
;
Onnx
.
Simple
.
write
nn
filename
;
filename
filename
(* Choose when to start the conversion to ONNX *)
let
heuristic
th_model
th_nn
term
=
let
heuristic
th_model
th_nn
term
=
match
term
.
Why3
.
Term
.
t_node
with
match
term
.
Why3
.
Term
.
t_node
with
|
Tapp
|
Tapp
...
...
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