From 10791d41d9ebcdcac59d73874d583acce3c9e1b9 Mon Sep 17 00:00:00 2001 From: Mike J Innes Date: Fri, 16 Feb 2018 02:53:35 +0000 Subject: [PATCH] update readme --- README.md | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 4fba3afa3..a40c526b1 100644 --- a/README.md +++ b/README.md @@ -9,29 +9,25 @@ Pkg.clone("https://github.com/FluxML/Metalhead.jl") This package provides computer vision models that run on top of the [Flux](http://fluxml.github.io/) machine learning library. -```julia -julia> using Metalhead +![IJulia Screenshot](https://i.imgur.com/spBsaz7.png) -julia> vgg = VGG19() -VGG19() +Each model (like `VGG19`) is a Flux layer, so you can do anything you would normally do with a model; like moving it to the GPU, training or freezing components, and extending it to carry out other tasks (such as neural style transfer). -julia> x = rand(Float32, 224, 224, 3, 1) # Dummy image data +```julia +# Run with dummy image data +julia> x = rand(Float32, 224, 224, 3, 1) 224×224×3×1 Array{Float32,4}: [:, :, 1, 1] = 0.353337 0.252493 0.444695 0.767193 … 0.107599 0.424298 0.218889 0.377959 0.247294 0.039822 0.829367 0.832303 0.582103 0.359319 0.259342 0.12293 ⋮ -julia> vgg19(x) +julia> vgg(x) 1000×1 Array{Float32,2}: 0.000851723 0.00079913 ⋮ -``` -Because models like `VGG19` are Flux layers, you can do anything you would normally do with a model, including moving it to the GPU, training or freezing components, and extending it to carry out other tasks (such as neural style transfer). - -```julia # See the underlying model structure julia> vgg.layers Chain(Conv2D((3, 3), 3=>64, NNlib.relu), Conv2D((3, 3), 64=>64, NNlib.relu), Metalhead.#3, Conv2D((3, 3), 64=>128, NNlib.relu), Conv2D((3, 3), 128=>128, NNlib.relu), Metalhead.#4, Conv2D((3, 3), 128=>256, NNlib.relu), Conv2D((3, 3), 256=>256, NNlib.relu), Conv2D((3, 3), 256=>256, NNlib.relu), Conv2D((3, 3), 256=>256, NNlib.relu), Metalhead.#5, Conv2D((3, 3), 256=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Metalhead.#6, Conv2D((3, 3), 512=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Conv2D((3, 3), 512=>512, NNlib.relu), Metalhead.#7, Metalhead.#8, Dense(25088, 4096, NNlib.relu), Flux.Dropout{Float32}(0.5f0, false), Dense(4096, 4096, NNlib.relu), Flux.Dropout{Float32}(0.5f0, false), Dense(4096, 1000), NNlib.softmax)