Coder Social home page Coder Social logo

mbrukman / knet.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from denizyuret/knet.jl

0.0 1.0 0.0 18.99 MB

Koç University deep learning framework.

License: Other

Makefile 0.91% Cuda 5.20% C 0.96% MATLAB 0.90% Julia 50.62% Perl 0.03% Python 0.20% M 0.01% Shell 0.01% Jupyter Notebook 41.17%

knet.jl's Introduction

Knet

Knet (pronounced "kay-net") is the Koç University deep learning framework implemented in Julia by Deniz Yuret and collaborators. It supports GPU operation and automatic differentiation using dynamic computational graphs for models defined in plain Julia. You can install Knet with the following at the julia prompt: using Pkg; Pkg.add("Knet"). Some starting points:

  • Tutorial: introduces Julia and Knet via examples.
  • Documentation: installation, introduction, design, implementation, full reference and deep learning chapters.
  • Examples: more tutorials and example models.
  • Benchmarks: comparison of Knet's speed with TensorFlow, PyTorch, DyNet etc.
  • Paper: Yuret, D. "Knet: beginning deep learning with 100 lines of julia." In Machine Learning Systems Workshop at NIPS 2016.
  • KnetML: github organization with Knet repos of models, tutorials, layer collections and other resources.
  • Images: Knet machine images are available for AWS, Singularity and Docker.
  • Issues: if you find a bug, please open a github issue.
  • knet-users: if you need help or would like to request a feature, please join this mailing list.
  • knet-dev: if you would like to contribute to Knet development, please join this mailing list and check out these tips.
  • knet-slack: Slack channel for Knet.
  • Related work: Please check out Flux, Mocha, JuliaML, JuliaDiff, JuliaGPU, JuliaOpt for related packages.

Example

Here is a simple example where we define, train and test the LeNet model for the MNIST handwritten digit recognition dataset from scratch using 13 lines of code and 30 seconds of GPU computation.

using Knet

# Define convolutional layer:
struct Conv; w; b; f; end
(c::Conv)(x) = c.f.(pool(conv4(c.w, x) .+ c.b))
Conv(w1,w2,cx,cy,f=relu) = Conv(param(w1,w2,cx,cy), param0(1,1,cy,1), f)

# Define dense layer:
struct Dense; w; b; f; end
(d::Dense)(x) = d.f.(d.w * mat(x) .+ d.b)
Dense(i::Int,o::Int,f=relu) = Dense(param(o,i), param0(o), f)

# Define a chain of layers and a loss function:
struct Chain; layers; end
(c::Chain)(x) = (for l in c.layers; x = l(x); end; x)
(c::Chain)(x,y) = nll(c(x),y)

# Load MNIST data:
include(Knet.dir("data","mnist.jl"))
dtrn, dtst = mnistdata()

# Define, train and test LeNet (about 30 secs on a gpu to reach 99% accuracy)
LeNet = Chain(Conv(5,5,1,20), Conv(5,5,20,50), Dense(800,500), Dense(500,10,identity))
adam!(LeNet, repeat(dtrn,10))
accuracy(LeNet, dtst)

Contributing

Knet is an open-source project and we are always open to new contributions: bug reports and fixes, feature requests and contributions, new machine learning models and operators, inspiring examples, benchmarking results are all welcome.

Current contributors:

  • Can Gümeli
  • Carlo Lucibello
  • Ekin Akyürek
  • Ekrem Emre Yurdakul
  • Emre Ünal
  • Emre Yolcu
  • Enis Berk
  • Erenay Dayanık
  • İlker Kesen
  • Meriç Melike Softa
  • Mike Innes
  • Onur Kuru
  • Ozan Arkan Can
  • Ömer Kırnap
  • Phuoc Nguyen
  • Rene Donner
  • Tim Besard
  • Zhang Shiwei

knet.jl's People

Contributors

denizyuret avatar ilkerkesen avatar cangumeli avatar ozanarkancan avatar enisberk avatar ekinakyurek avatar carlolucibello avatar eeyrdkl avatar maleadt avatar ereday avatar kirnap avatar kuruonur1 avatar tkelman avatar quaertym avatar ahmetumutdurmus avatar chrisrackauckas avatar daehyok avatar emreyolcu avatar mortenpi avatar rfourquet avatar melikesofta avatar xiaodaigh avatar undefdev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.