Knet

Koç 大学深度学习框架。「Koç University deep learning framework.」

Github星跟踪图

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 15 lines of code and 10 seconds of GPU computation.

# Install packages before first run: using Pkg; pkg"add Knet IterTools MLDatasets"
using Knet, IterTools, MLDatasets

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

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

# 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:
xtrn,ytrn = MNIST.traindata(Float32); ytrn[ytrn.==0] .= 10
xtst,ytst = MNIST.testdata(Float32);  ytst[ytst.==0] .= 10
dtrn = minibatch(xtrn, ytrn, 100; xsize = (28,28,1,:))
dtst = minibatch(xtst, ytst, 100; xsize = (28,28,1,:))

# Define and train LeNet (~10 secs on a GPU or ~3 mins on a CPU to reach ~99% accuracy)
LeNet = Chain((Conv(5,5,1,20), Conv(5,5,20,50), Dense(800,500,f=relu), Dense(500,10)))
progress!(adam(LeNet, ncycle(dtrn,3)))
accuracy(LeNet,data=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. See Tips for Developers for instructions.

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

主要指标

概览
名称与所有者denizyuret/Knet.jl
主编程语言Jupyter Notebook
编程语言Makefile (语言数: 5)
平台
许可证Other
所有者活动
创建于2015-09-29 23:42:37
推送于2024-11-15 16:59:30
最后一次提交2022-03-09 20:08:08
发布数44
最新版本名称v1.4.10 (发布于 2022-02-12 21:04:23)
第一版名称v0.7.3 (发布于 2016-09-17 02:04:43)
用户参与
星数1.4k
关注者数82
派生数228
提交数3.1k
已启用问题?
问题数495
打开的问题数140
拉请求数124
打开的拉请求数13
关闭的拉请求数49
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?