Skip to content

Commit a2c3c37

Browse files
committed
Tiny cleanup of nn_blocks.ml
1 parent 721044b commit a2c3c37

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

lib/nn_blocks.ml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
(** Prior to OCANNL 0.5, this module is just a placeholder hinting at an intended design pattern for
2-
model components. *)
3-
41
open! Base
52
module TDSL = Operation.TDSL
63
module NTDSL = Operation.NTDSL
74

85
let%op mlp_layer ~label ~hid_dim () x = relu (({ w = uniform () } * x) + { b = 0.; o = [ hid_dim ] })
96

10-
let mlp ~hid_dims =
7+
let mlp ~label ~hid_dims () =
118
let layers =
129
List.mapi hid_dims ~f:(fun i hid_dim ->
13-
mlp_layer ~label:[ "L" ^ Int.to_string i ] ~hid_dim ())
10+
mlp_layer ~label:(("L" ^ Int.to_string i) :: label) ~hid_dim ())
1411
in
1512
fun x -> List.fold layers ~init:x ~f:(fun x layer -> layer x)

0 commit comments

Comments
 (0)