Commit 8d79b1f2 authored by Aymeric Varasse's avatar Aymeric Varasse
Browse files

Adapted linearization param to handle Input

parent d1d5cdcc
......@@ -272,7 +272,7 @@ module Vertex = struct
| Pool_params of (ksize*stride option*pads option*dilations option)
| Conv_params of (ksize*stride option*pads option*dilations option)
| Transpose_params of shape
| RW_Linearized_ReLu_params of (((float * float * float) list) * ((string, float) Base.Hashtbl.t list * int))
| RW_Linearized_ReLu_params of ((bool list list) * ((string, float) Base.Hashtbl.t list * int))
let str_op_params p = match p with
| Transpose_params s ->
let str_sh = str_shape s
......@@ -291,17 +291,12 @@ module Vertex = struct
in "Pool params: KSIZE: "^str_k^
", Pads: "^str_p^", Stride: "^str_s^
", Dilations: "^str_d
| RW_Linearized_ReLu_params l ->
let str_lin l =
let float_tuple_to_string t =
match t with
| (x1,x2,x3) -> "("^Base.Float.to_string x1^", "^Base.Float.to_string x2^", "^Base.Float.to_string x3^")"
in
let string_list = List.map ~f:float_tuple_to_string l in
let list_to_string l = String.concat ~sep:";" l in
list_to_string string_list
in
"RW_Linearized_ReLu_params: "^(str_lin (fst l))
| RW_Linearized_ReLu_params l -> (* Only displays the activation scheme on the ReLU node *)
let activations = fst l in
let act' = List.map ~f:(fun l1 -> List.map ~f:(fun b -> match b with true -> "true" | false -> "false") l1) activations in
let act'' = List.map ~f:(fun l -> "["^(String.concat ~sep:";" l)^"]") act' in
let act''' = "["^(String.concat ~sep:";" act'')^"]" in
"RW_Linearized_ReLu_params: "^act'''
type t = {
id: id;
name: string option;
......
......@@ -144,7 +144,7 @@ module Vertex : sig
| Pool_params of (ksize*stride option*pads option*dilations option)
| Conv_params of (ksize*stride option*pads option*dilations option)
| Transpose_params of shape
| RW_Linearized_ReLu_params of (((float * float * float) list) * ((string, float) Base.Hashtbl.t list * int))
| RW_Linearized_ReLu_params of ((bool list list) * ((string, float) Base.Hashtbl.t list * int))
val str_op_params : operator_parameters -> string
......
......@@ -420,9 +420,7 @@ let pp_relu_linear tname n env t g =
| None -> failwith "Something is odd with the operator_parameters"
in
let tbl = Base.fst (Base.snd n_op) in
let is_positive x = if (x >= 0.) then true else false in
let is_positive_tuple (x0, x1, x2) = [is_positive x0; is_positive x1; is_positive x2] in
let to_activate = Base.List.map ~f:is_positive_tuple (Base.fst n_op) in
let to_activate = Base.fst n_op in
let relu_cell_to_smt idx =
let idx_str = stringify_int idx in
let idx_0 = Base.List.nth_exn idx 2 in
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment