Skip to content

Instantly share code, notes, and snippets.

View ryanrhymes's full-sized avatar
🎯
Focusing

Liang Wang ryanrhymes

🎯
Focusing
View GitHub Profile
@ryanrhymes
ryanrhymes / README.md
Created April 9, 2019 12:17
Owl Demo @ ReasonML 2019

Owl Demo @ ReasonML 2019

@ryanrhymes
ryanrhymes / #readme.md
Last active May 2, 2018 11:02
A bunch of CSV files to demonstrate the dataframe module in Owl

The Zoo gist contains a bunch of CSV files to demonstrate the dataframe module.

@ryanrhymes
ryanrhymes / README.md
Last active February 24, 2018 20:45
Zoo - VGG16
@ryanrhymes
ryanrhymes / README.md
Last active February 24, 2018 20:41
Zoo - SqueezeNet

SqueezeNet

Squeezenet is one of the recent models to do image recognition, with focus on model size reduction. It can achieve AlexNet-level accuracy on ImageNet with 50x fewer parameters. The original paper of this network is here.

Usage

This gist implements an Squeezenet service in Owl, and provides simple interfaces to use. Here is an example:

#zoo "c424e1d1454d58cfb9b0284ba1925a48"
@ryanrhymes
ryanrhymes / InceptionV3.ml
Last active February 24, 2018 20:37
Zoo - Google InceptionV3
#!/usr/bin/env owl
open Owl
open Owl_types
open Algodiff.S
open Neural
open Neural.S
open Neural.S.Graph
@ryanrhymes
ryanrhymes / README.md
Last active February 24, 2018 20:34
Zoo - Neural Style Transfer

Neural Style Transfer

Neural Style Transfer is the process of using Deep Neural Networks to migrate the semantic content of one image to different styles.

Usage

This gist implements NST in Owl, and provides a simple interfaces to use. Here is an example:

#zoo "6f28d54e69d1a19c1819f52c5b16c1a1"
(* find the root inputs of [x] *)
let find_roots x =
let s = Owl_utils.Stack.make () in
let rec _find x =
Array.iter (fun n ->
if n.op = Noop then Owl_utils.Stack.push s n
else _find n
) x.prev
in
_find x;
module M = Owl_lazy.Make (Arr);;
let x = Arr.uniform [|8;8|];;
let a = M.of_ndarray x;;
let b = M.(a |> sin |> cos);;
M._eval_term b;;
module M = Owl_lazy.Make (Arr);;
let x = Arr.uniform [|8;8|];;
let y = Arr.uniform [|8;8|];;
#require "owl_opencl";;
open Owl_opencl_operand;;
let x = Arr (Dense.Ndarray.S.uniform [|10;10|]);;
let y = Owl_opencl_dense.add_scalar x (F 1.);;
let z = Owl_opencl_dense.cos y;;
eval z;;
#require "owl_opencl";;
open Owl_opencl_operand;;
#require "owl_opencl";;
let x0 = Dense.Ndarray.S.uniform [|5;5|];;
let x1 = Dense.Ndarray.S.uniform [|5;5|];;
let x2 = Dense.Ndarray.S.uniform [|5;5|];;
let x3 = Owl_opencl_dense.(add (Arr x0) (Arr x1));;
let x4 = Owl_opencl_dense.(add x3 (Arr x2));;
Owl_opencl_dense.eval x4;;