Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Liang Wang ryanrhymes

🎯
Focusing
View GitHub Profile
@ryanrhymes
ryanrhymes / README.md
Created Apr 9, 2019
Owl Demo @ ReasonML 2019
View README.md

Owl Demo @ ReasonML 2019

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

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

View README.md
@ryanrhymes
ryanrhymes / README.md
Last active Feb 24, 2018
Zoo - SqueezeNet
View README.md

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 Feb 24, 2018
Zoo - Google InceptionV3
View InceptionV3.ml
#!/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 Feb 24, 2018
Zoo - Neural Style Transfer
View README.md

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"
View lazyy.ml
(* 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;
View exp_lazy.ml
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|];;
View exp_opencl_02.ml
#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;;
View exp_opencl_01.ml
#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;;
You can’t perform that action at this time.