File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -78,9 +78,7 @@ let%op model () =
7878 let conv1 = conv2d ~kernel_size:3 () in
7979 let pool = max_pool2d () in
8080 fun x ->
81- let x = conv1 x in
82- let x = relu x in
83- let x = pool x in
81+ let x = conv1 x |> relu |> pool in
8482 (* No flattening needed - FC layer works with spatial dims *)
8583 { w_out } * x + { b_out = 0.; o = [10] }
8684```
@@ -116,11 +114,7 @@ let%op resnet_block () =
116114 let bn2 = batch_norm2d () in
117115 fun ~train_step x ->
118116 let identity = x in
119- let out = conv1 x in
120- let out = bn1 ~train_step out in
121- let out = relu out in
122- let out = conv2 out in
123- let out = bn2 ~train_step out in
117+ let out = conv1 x |> bn1 ~train_step |> relu |> conv2 |> bn2 ~train_step in
124118 relu (out + identity)
125119```
126120
You can’t perform that action at this time.
0 commit comments