3-Layer MNIST Ver. 1 -- Repeat layer
Change 1-layer mnist data to 3 layers. Result: converge OK.
3-Layer MNIST Ver. 1 -- Repeat layer
Change 1-layer mnist data to 3 layers. Result: converge OK.
#!/usr/bin/env owl | |
#zoo "980a43a65e78613b4912c69008b3e909" | |
open Owl | |
let x, _, _ = Dataset.load_cifar_test_data () in | |
let x = Dense.Ndarray.Generic.cast_s2d x | |
|> Dense.Ndarray.D.get_slice_simple [[];[];[];[0]] | |
|> Dense.Ndarray.D.squeeze | |
in |
#!/usr/bin/env owl | |
open Owl | |
open Owl_neural | |
open Algodiff.S | |
open Owl_neural_neuron | |
let model () = | |
let open Owl_neural_graph in | |
let nn = input [|28;28;3|] |
#!/usr/bin/env owl | |
open Owl | |
open Owl_neural | |
open Owl_neural_graph | |
open Algodiff.S | |
open Owl_neural_neuron | |
let model_name = "cifar10.model" | |
let test_batch = 10 |
VisualModule
Visualize image dataset. Currently support MNIST and CIFAR10. visualize_dataset
takes 2 arguments:
imgs
of type Dense.Ndarray.D.arr,len
, of type int, for showing lenxlen
images sample from the imgs
InceptionV3 is one of Google’s latest effort to do image recognition. This is a standard task in computer vision, where models try to classify entire images into 1000 classes, like "Zebra", "Dalmatian", and "Dishwasher". Compared with previous DNN models, InceptionV3 has one of the most complex networks architectures in computer vision models. The original paper of this network is here.
This gist implements an InceptionV3 service in Owl, and provides simple interfaces to use. Here is an example:
#zoo "9428a62a31dbea75511882ab8218076f"
#!/usr/bin/env owl | |
#zoo "980a43a65e78613b4912c69008b3e909" (*Import the VisualModule *) | |
(* Trains a simple convnet on the MNIST dataset. Network structure adapted from | |
* Keras example: https://github.com/fchollet/keras/blob/master/examples/mnist_cnn.py | |
*) | |
open Owl | |
open Owl_neural | |
open Algodiff.S |
#!/usr/bin/env owl | |
open Owl | |
let _read_ppm fname = | |
(* grayscale binary ppm reading *) | |
let fp = open_in fname in | |
let ver = input_line fp in (* version *) | |
if ver <> "P6" then (* expect a .ppm file *) |
# get the conv layers | |
cp owl_inception_structure.txt conv_structure.txt | |
sed -i.bak '/\[ Node conv2d/,/^\s*$/' conv_structure.txt | |
diff -biw conv_structure.txt owl_inception_structure.txt | sed -n 's/^> //p' |