# Best Julia Package for Neural Networks

**URL:** <https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358>\
**Category:** Machine Learning\
**Tags:** question\
**Created:** [August 22, 2020, 10:01am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358 "2020-08-22T10:01:50Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jojo\_Dad](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jojo_dad/32/8620_2.png) [@Jojo\_Dad](https://discourse.julialang.org/u/Jojo_Dad)\
**Post date:** [August 22, 2020, 10:01am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/1 "2020-08-22T10:01:50Z")

</div>

What is currently the best machine learning package in Julia?

First, in terms of ease of use for students.

Second, in terms of capability & performance for experts?

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [August 22, 2020, 11:02am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/2 "2020-08-22T11:02:34Z")

</div>

Flux.jl and Knet.jl are the most popular

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [August 23, 2020, 3:51am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/3 "2020-08-23T03:51:53Z")

</div>

Flux.jl is amazingly easy to read. By far the most readable nn package I ever used

If you’re looking for a general ML package, then MLJ.jl is your best bet! It’s an interface and it can access Flux.jl and other ML packages

---

<div class="post-metadata">

**Author:** ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Post date:** [August 23, 2020, 3:52am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/4 "2020-08-23T03:52:35Z")

</div>

> [@Albert\_Zevelev](#):
>
> By far the most readable

Do you mean API level like `Chain` or the underlying code?

---

<div class="post-metadata">

**Author:** ![Albert\_Zevelev](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albert_zevelev/32/11844_2.png) [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Post date:** [August 23, 2020, 3:53am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/5 "2020-08-23T03:53:47Z")

</div>

I meant the underlying code, but I like both

---

<div class="post-metadata">

**Author:** ![andevellicus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andevellicus/32/15097_2.png) [@andevellicus](https://discourse.julialang.org/u/andevellicus)\
**Post date:** [August 26, 2020, 1:55pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/6 "2020-08-26T13:55:44Z")

</div>

My own personal experiences with both:  
Ease of use? Probably Flux.

Performance? Knet.

Not sure if this is unique to me, but my custom models with large 3D data, an epoch on a single core of my K80 takes 35 minutes in Flux. The same model in Knet with the recent CUDA changes takes 10 minutes. YMMV.

Flux comes “ready to go,” whereas Knet performs the underlying NN computations but you have to define your own layers (not too big of a deal to be honest). The maintainer of Knet is very active and is constantly updating the package. In fact I think he’s working on implementing a layers interface, so that should be available soon.

---

<div class="post-metadata">

**Author:** ![Yifan\_Liu](https://avatars.discourse-cdn.com/v4/letter/y/4da419/32.png) [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Post date:** [August 26, 2020, 3:19pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/7 "2020-08-26T15:19:46Z")

</div>

I am also looking at Knet recently, but it seems like a one-person project. Not sure how long it will be maintained.

---

<div class="post-metadata">

**Author:** ![andevellicus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andevellicus/32/15097_2.png) [@andevellicus](https://discourse.julialang.org/u/andevellicus)\
**Post date:** [August 26, 2020, 3:37pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/8 "2020-08-26T15:37:37Z")

</div>

Keras was a one person project for a very long time 😉

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [August 26, 2020, 4:38pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/9 "2020-08-26T16:38:33Z")

</div>

+1 for Knet. I’ve been using it for the past two years and it’s getting better and better. I somehow find the underlying code more user friendly and easier to understand for a newbie in comparison to Flux(although Flux is more elegant, I still find it harder to understand).  
When I started I was very curious about the internals so I used the debugger a lot. In the case of Knet, if you start debugging, you’ll encounter mostly three “code blocks”: the types(Chain, Conv which you defined), a whole bunch of iterators over your data and the backpropagation part where you can see the tape being created. The single obscure part I found is the primitives for the backpropagation which are automatically generated and you cannot “step into” them (you can find them in Autograd.jl).  
I does receive contributions from other users, but my impression is that the core stuff is maintained only by Deniz Yuret. Now it should gain more traction since the transition to CuArrays is mostly done and there is no need anymore for separate compilation of the kernels at installation.

---

<div class="post-metadata">

**Author:** ![hiiroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hiiroo/32/8820_2.png) [@hiiroo](https://discourse.julialang.org/u/hiiroo)\
**Post date:** [August 26, 2020, 6:02pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/10 "2020-08-26T18:02:49Z")

</div>

Actually, it is maintained by a research group at Koç University.

---

<div class="post-metadata">

**Author:** ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Post date:** [August 26, 2020, 6:46pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/11 "2020-08-26T18:46:18Z")

</div>

I haven’t used Knet recently but at the time it was a bit lower level than Flux, which is sometimes better for learning and debugging, while Flux feels more like magic, which is more convenient to use when it works.

---

<div class="post-metadata">

**Author:** ![sylvaticus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sylvaticus/32/203883_2.png) [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Post date:** [August 26, 2020, 7:31pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/12 "2020-08-26T19:31:14Z")

</div>

I am tempted to add to the list my own package, [BetaML](https://github.com/sylvaticus/BetaML.jl), a repository of ML algorithms (Feed-forward NN with _optional_ AD, Clustering/Reccomendation Systems, Linear/Kernel Classifiers, Decision Trees/Random Forests).

It is nowere close to the other packages in the list in terms of performances/capabilities, but it is _very_ easy to use and the code is readable by a beginner (indeed, it has been wrote by a beginner… 🙂 ) to understand the basic of the various ML methods…

Note: in the title you say “NN”, but then your question is about ML algorithms… NN are “only” one category of ML algorithms…

---

<div class="post-metadata">

**Author:** ![andevellicus](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/andevellicus/32/15097_2.png) [@andevellicus](https://discourse.julialang.org/u/andevellicus)\
**Post date:** [September 16, 2020, 11:47pm UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/13 "2020-09-16T23:47:08Z")

</div>

The other thing you could do is just try both. They are similar enough in my experience that it doesn’t take much to port code from one to another; in fact I started in Flux and then moved over to Knet due to performance improvements. See which one works for your use case.

---

<div class="post-metadata">

**Author:** ![Stergios\_Papadimitri](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stergios_papadimitri/32/216738_2.png) [@Stergios\_Papadimitri](https://discourse.julialang.org/u/Stergios_Papadimitri)\
**Post date:** [March 12, 2026, 10:46am UTC](https://discourse.julialang.org/t/best-julia-package-for-neural-networks/45358/14 "2026-03-12T10:46:44Z")

</div>

Flux is the best Julia Deep Learning Framework, easy to learn and efficient.
