diff --git a/examples/backprop.ml b/examples/backprop.ml index e838fbbeb..d714918aa 100755 --- a/examples/backprop.ml +++ b/examples/backprop.ml @@ -1,9 +1,11 @@ -#!/usr/bin/env owl (* This example demonstrates how to write the backpropogation algorithm from scratch using Algodiff module. With the backprop algorithm, we further make a naive neural network without using Owl' DNN to train on mnist dataset. + + Execute 'Dataset.download_all ()' to accquire all necessary dataset before running this example.' *) + open Owl open Algodiff.S @@ -49,7 +51,7 @@ let backprop nn eta x y = loss |> unpack_flt let test nn x y = - Dense.Matrix.S.iter2_rows (fun u v -> + Dense.Matrix.S.iter2_rows (fun u _ -> Dataset.print_mnist_image u; let p = run_network (Arr u) nn |> unpack_arr in Dense.Matrix.Generic.print p; diff --git a/examples/checkpoint.ml b/examples/checkpoint.ml index 27a72e3bb..5c66bc475 100755 --- a/examples/checkpoint.ml +++ b/examples/checkpoint.ml @@ -1,4 +1,3 @@ -#!/usr/bin/env owl (* This example shows how to use checkpoint in a stateful optimisation. *) open Owl diff --git a/examples/cifar10_vgg.ml b/examples/cifar10_vgg.ml index 460d40166..13ac3d31f 100755 --- a/examples/cifar10_vgg.ml +++ b/examples/cifar10_vgg.ml @@ -1,4 +1,3 @@ -#!/usr/bin/env owl (* This example demonstrates how to build a VGG-like convolutional neural * network for CIFAR10 dataset. *) diff --git a/examples/computation_graph_01.ml b/examples/computation_graph_01.ml index 91b82c603..837570d23 100755 --- a/examples/computation_graph_01.ml +++ b/examples/computation_graph_01.ml @@ -1,4 +1,8 @@ -#!/usr/bin/env owl +(* + * Please install the graphvis tool before executing this example. + E.g. on Ubuntu system: `sudo apt install graphviz` +*) + open Owl module G = Owl_computation_cpu_engine.Make (Owl_algodiff_primal_ops.D) diff --git a/examples/computation_graph_02.ml b/examples/computation_graph_02.ml index db51470c8..a7fcdd48e 100755 --- a/examples/computation_graph_02.ml +++ b/examples/computation_graph_02.ml @@ -1,4 +1,8 @@ -#!/usr/bin/env owl +(* + * Please install the graphvis tool before executing this example. + E.g. on Ubuntu system: `sudo apt install graphviz` +*) + open Owl module G = Owl_computation_cpu_engine.Make (Owl_algodiff_primal_ops.D) diff --git a/examples/dune b/examples/dune new file mode 100644 index 000000000..594094b39 --- /dev/null +++ b/examples/dune @@ -0,0 +1,3 @@ +(executable + (name backprop) + (libraries owl)) \ No newline at end of file diff --git a/examples/regression.ml b/examples/regression.ml index 17cb6a7af..7cac0ffe9 100755 --- a/examples/regression.ml +++ b/examples/regression.ml @@ -53,12 +53,13 @@ let test_poly () = let z = Array.init (n + 1) (fun i -> Mat.(pow_scalar x (float_of_int i))) |> Mat.concatenate ~axis:1 in - let y' = Mat.(z *@ p) in + Mat.(z *@ p) + (* let y' = Mat.(z *@ p) in let open Owl_plplot in let h = Plot.create "plot_regression.png" in Plot.(scatter ~h ~spec:[ RGB (100,100,50) ] x y); Plot.(scatter ~h ~spec:[ Marker "+" ] x y'); - Plot.output h + Plot.output h *) let _ =