Skip to content
Liang Wang edited this page Aug 18, 2017 · 17 revisions

#0 How to quickly try out the latest build?

This can be achieved by simply pulling Owl's docker image.

docker pull ryanrhymes/owl
docker run -t -i ryanrhymes/owl

If you want to run Owl on different platforms such as ARM, please refer here for more details.

#1 How to make toplevel automatically load Owl when it starts?

You can edit the .ocamlinit file in your home directory by adding the following lines.

#use "topfind"
#require "owl"
open Owl

If you don't want to open Owl module, please remove the open Owl. If you use utop rather than OCaml's default toplevel, remove the redundant #use "topfind".

#2 How to check the performance of Linalg module?

Calling the Linalg.Generic.peakflops () function will return you the number of float operations per second (flops). This number is derived by calculating the amount of time spent in multiplying two 2000 x 2000 matrices. Julia provides the same function and you can use this to compare two.

#3 How to measure the time spent in an operation?

Owl.Utils.time function can be used to measure the time spent in one operation. It takes a function of type (unit -> 'a) as input and returns a float number represent the time in ms. Here is an example.

let x = Mat.uniform 1000 1000 in
let f () = Mat.sum x in
Owl.Utils.time f;;

#4 How to concatenate a list of ndarrays/matrice?

#5 How to split an ndarray?