# Machine Learning

**URL:** https://discourse.julialang.org/c/domain/ml/24.md?page=48

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 49

---

## [Does Knet support nested gradient for conv?](https://discourse.julialang.org/t/does-knet-support-nested-gradient-for-conv/30805)

<div class="topic-metadata">

**Author:** [@zht](https://discourse.julialang.org/u/zht)\
**Replies:** 1\
**Last updated:** [November 12, 2019, 6:30am UTC](https://discourse.julialang.org/t/does-knet-support-nested-gradient-for-conv/30805 "2019-11-12T06:30:15Z")

</div>

I need to take the grad of grad of an NN (this is needed for WGAN with grad penalty regularizations). I just found out that Flux (0.9 release) does not support it: Nested AD not defined for conv Stacktrace: ... I am c…

---

## [What's wrong with this Flux model definitin?](https://discourse.julialang.org/t/whats-wrong-with-this-flux-model-definitin/30816)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 3:13am UTC](https://discourse.julialang.org/t/whats-wrong-with-this-flux-model-definitin/30816 "2019-11-07T03:13:57Z")

</div>

I am on the latest master branch of Flux.jl using Flux using CuArrays CuArrays.allowscalar(false) x = gpu(rand(Float32, 1\_000\_000, 2)) y = 2 .\* x + gpu(rand(Float32, 1\_000\_000)) w = gpu(rand(2, 1)) loss(x, y) = Flux.m…

---

## [Toy Flux example with one paramemeter not working?](https://discourse.julialang.org/t/toy-flux-example-with-one-paramemeter-not-working/30679)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [November 4, 2019, 10:21am UTC](https://discourse.julialang.org/t/toy-flux-example-with-one-paramemeter-not-working/30679 "2019-11-04T10:21:34Z")

</div>

I am trying to write a blog for people with no background in machine learning using the Flux framework. However, I can’t seem to figure out how to get it to work. using Flux w = param(rand()) x = 1 y = 0.5 loss(x) = (w…

---

## [Upsampling in Flux.jl](https://discourse.julialang.org/t/upsampling-in-flux-jl/25919)

<div class="topic-metadata">

**Author:** [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Replies:** 7\
**Last updated:** [November 3, 2019, 9:28pm UTC](https://discourse.julialang.org/t/upsampling-in-flux-jl/25919 "2019-11-03T21:28:05Z")

</div>

I try to implement a convolutional auto-encoder with Flux.jl . I have a simple version working in python (Tensforflow Keras API). However the Flux.jl based model does not seem to converge and gives poor results even on t…

---

## [Difference between functor and treelike in Flux?](https://discourse.julialang.org/t/difference-between-functor-and-treelike-in-flux/30641)

<div class="topic-metadata">

**Author:** [@zht](https://discourse.julialang.org/u/zht)\
**Replies:** 1\
**Last updated:** [November 3, 2019, 8:56am UTC](https://discourse.julialang.org/t/difference-between-functor-and-treelike-in-flux/30641 "2019-11-03T08:56:03Z")

</div>

In Flux some layers are decorated with @functor and some are with @treelike. I assume this is so that functions like params can find the parameters. What is the difference between the two? For example I think Chain, Dens…

---

## [Simple Flux model not learning](https://discourse.julialang.org/t/simple-flux-model-not-learning/30138)

<div class="topic-metadata">

**Author:** [@rsteckel](https://discourse.julialang.org/u/rsteckel)\
**Replies:** 4\
**Last updated:** [October 21, 2019, 7:05pm UTC](https://discourse.julialang.org/t/simple-flux-model-not-learning/30138 "2019-10-21T19:05:21Z")

</div>

I’ve been trying to get a feel for Flux by modeling a simple non-linear function (X^2). At the end of each epoch, I print the model output for 3 (expecting 9), but it seems to converge to ~34 Can anyone see what I’m do…

---

## [Python RL environments from Julia](https://discourse.julialang.org/t/python-rl-environments-from-julia/30123)

<div class="topic-metadata">

**Author:** [@Sarvjeet](https://discourse.julialang.org/u/Sarvjeet)\
**Replies:** 2\
**Last updated:** [October 21, 2019, 6:30pm UTC](https://discourse.julialang.org/t/python-rl-environments-from-julia/30123 "2019-10-21T18:30:59Z")

</div>

Hi there, Since most of the reinforcement learning environments for robotics etc. applications are available in Python so I was wondering if I could implement RL algorithms in Julia and still train those agents written …

---

## [Right location/repo for RL algorithms](https://discourse.julialang.org/t/right-location-repo-for-rl-algorithms/30122)

<div class="topic-metadata">

**Author:** [@Sarvjeet](https://discourse.julialang.org/u/Sarvjeet)\
**Replies:** 1\
**Last updated:** [October 21, 2019, 6:05am UTC](https://discourse.julialang.org/t/right-location-repo-for-rl-algorithms/30122 "2019-10-21T06:05:33Z")

</div>

Hi there, I am taking a Deep RL course; would like to implement some deep RL algorithms for practice. I am not sure if I should contribute to Flux.jl, Reinforce.jl, Knet.jl or some other place. Can someone please tell t…

---

## [Help me build a Flux.jl model and learn basic ML concepts](https://discourse.julialang.org/t/help-me-build-a-flux-jl-model-and-learn-basic-ml-concepts/30109)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 1\
**Last updated:** [October 20, 2019, 2:22pm UTC](https://discourse.julialang.org/t/help-me-build-a-flux-jl-model-and-learn-basic-ml-concepts/30109 "2019-10-20T14:22:25Z")

</div>

I am learning the basics of ML/Flux.jl and I’m trying to build a simple model to get started. I grabbed some data from the U.S. Census Bureau and went ahead and created a gist on GitHub that contains a small cut (3,000 r…

---

## [Flux.jl MethodError ... (::Dense{typeof(identity),... on simple Chain model](https://discourse.julialang.org/t/flux-jl-methoderror-dense-typeof-identity-on-simple-chain-model/29247)

<div class="topic-metadata">

**Author:** [@m\_Tucci](https://discourse.julialang.org/u/m_Tucci)\
**Replies:** 3\
**Last updated:** [October 17, 2019, 12:38pm UTC](https://discourse.julialang.org/t/flux-jl-methoderror-dense-typeof-identity-on-simple-chain-model/29247 "2019-10-17T12:38:38Z")

</div>

Hi, I’m new to using Flux and I keep getting a data type error when running the following code: using LinearAlgebra, Flux, Base.Iterators, Statistics using CuArrays using Flux: onehotbatch, onecold, crossentropy, thrott…

---

## [Custom RNN with Flux gives an error with Flux.train!](https://discourse.julialang.org/t/custom-rnn-with-flux-gives-an-error-with-flux-train/30008)

<div class="topic-metadata">

**Author:** [@KK\_JuliaNoob](https://discourse.julialang.org/u/KK_JuliaNoob)\
**Replies:** 0\
**Last updated:** [October 17, 2019, 3:56am UTC](https://discourse.julialang.org/t/custom-rnn-with-flux-gives-an-error-with-flux-train/30008 "2019-10-17T03:56:09Z")

</div>

I am making a custom RNN layer based on the code in recurrent.jl in the Flux code base. However, when I try to train the model using the task given in the character rnn model zoo example (char-rnn.jl), I get an error sa…

---

## [Package for precision / recall?](https://discourse.julialang.org/t/package-for-precision-recall/29868)

<div class="topic-metadata">

**Author:** [@mpratland](https://discourse.julialang.org/u/mpratland)\
**Replies:** 4\
**Last updated:** [October 14, 2019, 11:05am UTC](https://discourse.julialang.org/t/package-for-precision-recall/29868 "2019-10-14T11:05:26Z")

</div>

I’m slowly moving all my personal projects and ML hacking over to Julia, so I’m trying to find substitutes for packages that I’m used to. On in particular I’m heavily dependent on is Python’s scikit-learn, and in particu…

---

## [Zygote gradient: problem with indexing constant arrays](https://discourse.julialang.org/t/zygote-gradient-problem-with-indexing-constant-arrays/29871)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 1\
**Last updated:** [October 14, 2019, 12:28am UTC](https://discourse.julialang.org/t/zygote-gradient-problem-with-indexing-constant-arrays/29871 "2019-10-14T00:28:14Z")

</div>

It looks super simple, function h(pars) my\_array = \[1.0, 2.0, 3.0\] indices = \[2,3,1\] # v = 0.0 for (c,i) in zip(pars,indices) v += c \* my\_array\[i\] end return v end h(\[1.0,2.0,3.0\]) # …

---

## [Shape of input arrays for an LSTM in Flux.jl? julia 1.0](https://discourse.julialang.org/t/shape-of-input-arrays-for-an-lstm-in-flux-jl-julia-1-0/27418)

<div class="topic-metadata">

**Author:** [@Simon\_Besnard](https://discourse.julialang.org/u/Simon_Besnard)\
**Replies:** 1\
**Last updated:** [October 13, 2019, 5:39pm UTC](https://discourse.julialang.org/t/shape-of-input-arrays-for-an-lstm-in-flux-jl-julia-1-0/27418 "2019-10-13T17:39:34Z")

</div>

I am currently trying to implement an LSTM model for a regression exercise using the flux.jl library. Although it is rather straightforward to build-up the model, I have rather some issues in understanding the right shap…

---

## [Write a GPU/CPU agnostic package with Flux](https://discourse.julialang.org/t/write-a-gpu-cpu-agnostic-package-with-flux/29734)

<div class="topic-metadata">

**Author:** [@jonathan-laurent](https://discourse.julialang.org/u/jonathan-laurent)\
**Replies:** 5\
**Last updated:** [October 11, 2019, 1:34pm UTC](https://discourse.julialang.org/t/write-a-gpu-cpu-agnostic-package-with-flux/29734 "2019-10-11T13:34:56Z")

</div>

I am currently developing a Julia package based on Flux (namely an implementation of Deepmind’s AlphaZero algorithm) and I am looking for the best way to make it accessible to people with and without a GPU. Ideally, ena…

---

## [Unable to save simple FLUX model with BSON](https://discourse.julialang.org/t/unable-to-save-simple-flux-model-with-bson/29628)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 2\
**Last updated:** [October 8, 2019, 4:40pm UTC](https://discourse.julialang.org/t/unable-to-save-simple-flux-model-with-bson/29628 "2019-10-08T16:40:10Z")

</div>

Hi, When I try to save a simple FLUX model like using Flux, BSON model = Chain( Conv((3, 3), 1=\>16, pad=(1,1), relu), MaxPool((2,2)), Conv((3, 3), 16=\>32, pad=(1,1), relu), MaxPool((2,2)), Conv((3,…

---

## [Error when setting up Flux and CuArrays](https://discourse.julialang.org/t/error-when-setting-up-flux-and-cuarrays/29079)

<div class="topic-metadata">

**Author:** [@John\_G](https://discourse.julialang.org/u/John_G)\
**Replies:** 4\
**Last updated:** [October 2, 2019, 4:22pm UTC](https://discourse.julialang.org/t/error-when-setting-up-flux-and-cuarrays/29079 "2019-10-02T16:22:32Z")

</div>

I get the following error whenever I run using Flux or using CuArrays, but I haven’t gotten the error when running any other Julia packages so far. Honestly I have no idea what it means or what to do about it, and any he…

---

## [Logistic Regression Package](https://discourse.julialang.org/t/logistic-regression-package/29354)

<div class="topic-metadata">

**Author:** [@infinitylabs](https://discourse.julialang.org/u/infinitylabs)\
**Replies:** 5\
**Last updated:** [October 1, 2019, 10:45am UTC](https://discourse.julialang.org/t/logistic-regression-package/29354 "2019-10-01T10:45:58Z")

</div>

Hi, Has anybody released a package foe logistic and multinomial regressions? We are planning to release one soon. Couldnt find a direct package like that in sklearn. Has anyone come across any such packages?

---

## [Polyaxon with Julia - anyone?](https://discourse.julialang.org/t/polyaxon-with-julia-anyone/29318)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [September 30, 2019, 11:46am UTC](https://discourse.julialang.org/t/polyaxon-with-julia-anyone/29318 "2019-09-30T11:46:11Z")

</div>

Is anyone using Polyaxon with Julia? I would appreciate hearing about your setup.

---

## [State of deep learning in Julia](https://discourse.julialang.org/t/state-of-deep-learning-in-julia/28049)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 18\
**Last updated:** [September 28, 2019, 1:08am UTC](https://discourse.julialang.org/t/state-of-deep-learning-in-julia/28049 "2019-09-28T01:08:07Z")

</div>

Although Julia is promoted as an excellent language for deep learning, I still don’t see any framework I could use in production or even in long-term research. Here are the options I considered in different periods of ti…

---

## [Simple custom recurrent layer in Flux](https://discourse.julialang.org/t/simple-custom-recurrent-layer-in-flux/26740)

<div class="topic-metadata">

**Author:** [@Rassibassi](https://discourse.julialang.org/u/Rassibassi)\
**Replies:** 2\
**Last updated:** [September 27, 2019, 10:45am UTC](https://discourse.julialang.org/t/simple-custom-recurrent-layer-in-flux/26740 "2019-09-27T10:45:36Z")

</div>

Hi, I am looking into Flux and trying to understand the recurrent functionality. The following code defines a first order low pass filter with Flux.Recur. using Flux using Flux.Tracker c = 0.5 function LP(h, x) h…

---

## [Export trained model to PMML](https://discourse.julialang.org/t/export-trained-model-to-pmml/29110)

<div class="topic-metadata">

**Author:** [@Carlos\_Roig](https://discourse.julialang.org/u/Carlos_Roig)\
**Replies:** 0\
**Last updated:** [September 24, 2019, 1:07pm UTC](https://discourse.julialang.org/t/export-trained-model-to-pmml/29110 "2019-09-24T13:07:21Z")

</div>

Hi there, I’m trying to find a way to export an already trained model to PMML formal, so I can integrate the model in a PMML consumer (Zementis Predictive Analytics). Is there any way to do that in Julia? In R and Pyth…

---

## [Using a onehot vector together with other data](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 8:34am UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007 "2019-09-23T08:34:56Z")

</div>

Is it possible to use a Flux.onehot vector together with other data as input to a Layer?

---

## [Zygote Performance](https://discourse.julialang.org/t/zygote-performance/29028)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 22\
**Last updated:** [September 23, 2019, 12:27am UTC](https://discourse.julialang.org/t/zygote-performance/29028 "2019-09-23T00:27:31Z")

</div>

At the moment I implement gradients for all my models, because I have not yet found that Julia’s AD packages come anywhere close to my fairly naive hand-optimised gradients. (The only exception is ForwardDiff on very sma…

---

## [Optical Music Recognition](https://discourse.julialang.org/t/optical-music-recognition/28834)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [September 19, 2019, 5:03pm UTC](https://discourse.julialang.org/t/optical-music-recognition/28834 "2019-09-19T17:03:02Z")

</div>

Is anyone interested in working on OMR in Julia? Warning: I am a total novice in ML :smiley: I’ve been looking for an excuse to finally take the dive into machine/deep learning in Julia and this is a project that I c…

---

## [Flux.jl: training fails at GPU but works on CPU](https://discourse.julialang.org/t/flux-jl-training-fails-at-gpu-but-works-on-cpu/28868)

<div class="topic-metadata">

**Author:** [@Martijn-R](https://discourse.julialang.org/u/Martijn-R)\
**Replies:** 1\
**Last updated:** [September 19, 2019, 1:06am UTC](https://discourse.julialang.org/t/flux-jl-training-fails-at-gpu-but-works-on-cpu/28868 "2019-09-19T01:06:03Z")

</div>

I have a Flux model that works OK on the CPU, but it fails when I switch to the GPU – see an MWE below. When I set gpu\_or\_cpu to cpu, loss drops to 0.004, but if I set it to gpu, the loss increases. I guess I am making …

---

## [Where does Julia provide the biggest benefits over other ML frameworks for research?](https://discourse.julialang.org/t/where-does-julia-provide-the-biggest-benefits-over-other-ml-frameworks-for-research/28481)

<div class="topic-metadata">

**Author:** [@Chillee](https://discourse.julialang.org/u/Chillee)\
**Replies:** 34\
**Last updated:** [September 16, 2019, 11:55am UTC](https://discourse.julialang.org/t/where-does-julia-provide-the-biggest-benefits-over-other-ml-frameworks-for-research/28481 "2019-09-16T11:55:30Z")

</div>

I’ve read a bunch of the blogs on the Julia website (e.g. on machine learning and programming languages), but I remain unconvinced about what large benefits Julia provides over PyTorch. For example, one section in the b…

---

## [Text Classification with Word Embeddings using Flux](https://discourse.julialang.org/t/text-classification-with-word-embeddings-using-flux/28751)

<div class="topic-metadata">

**Author:** [@Nigel\_Adams](https://discourse.julialang.org/u/Nigel_Adams)\
**Replies:** 2\
**Last updated:** [September 14, 2019, 3:09am UTC](https://discourse.julialang.org/t/text-classification-with-word-embeddings-using-flux/28751 "2019-09-14T03:09:50Z")

</div>

I’ve been experimenting with text classification using word embeddings and Flux. The posts start simple and work their way up to a project using 1d Convolutions. I couldn’t find many Julia examples on the web in this a…

---

## [How to compute partial derivatives efficiently with Zygote](https://discourse.julialang.org/t/how-to-compute-partial-derivatives-efficiently-with-zygote/28731)

<div class="topic-metadata">

**Author:** [@SEA](https://discourse.julialang.org/u/SEA)\
**Replies:** 2\
**Last updated:** [September 13, 2019, 7:23pm UTC](https://discourse.julialang.org/t/how-to-compute-partial-derivatives-efficiently-with-zygote/28731 "2019-09-13T19:23:38Z")

</div>

Suppose we have a function f(x, y), and want to compute \\partial\_x f(x,y) for many y’s, ideally using no memory allocation. Using Zygote, I tried Zygote.forwarddiff(y-\>f(x,y), y). However, I believe this creates a new a…

---

## [How to do batching in Flux's recurrent sequence model to take advantage of GPU during training?](https://discourse.julialang.org/t/how-to-do-batching-in-fluxs-recurrent-sequence-model-to-take-advantage-of-gpu-during-training/28678)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 1\
**Last updated:** [September 12, 2019, 10:37am UTC](https://discourse.julialang.org/t/how-to-do-batching-in-fluxs-recurrent-sequence-model-to-take-advantage-of-gpu-during-training/28678 "2019-09-12T10:37:38Z")

</div>

Suppose I have a recurrent model in Flux, say using Flux D = 2 m = RNN(D,3) If want to apply it to sequence, then the documentation says I should represent my sequence seq as a vector of vectors, so something like T =…

[Previous page](https://discourse.julialang.org/c/domain/ml/24.md?page=47)

[Next page](https://discourse.julialang.org/c/domain/ml/24.md?page=49)
