# Machine Learning

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

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

**Page:** 42

---

## [Flux training GPU vs CPU different results](https://discourse.julialang.org/t/flux-training-gpu-vs-cpu-different-results/45165)

<div class="topic-metadata">

**Author:** [@luboshanus](https://discourse.julialang.org/u/luboshanus)\
**Replies:** 7\
**Last updated:** [August 20, 2020, 8:19pm UTC](https://discourse.julialang.org/t/flux-training-gpu-vs-cpu-different-results/45165 "2020-08-20T20:19:02Z")

</div>

Hi, I have a problem while training on GPU vs CPU. Or when I just once run train function it goes completely off while on GPU. If I choose CPU it just stays “converge” and not go further away. An example of 3 runs on GP…

---

## [TextAnalysis.jl Naive Bayes Load Error](https://discourse.julialang.org/t/textanalysis-jl-naive-bayes-load-error/45115)

<div class="topic-metadata">

**Author:** [@Chris\_Anderson](https://discourse.julialang.org/u/Chris_Anderson)\
**Replies:** 0\
**Last updated:** [August 17, 2020, 3:35pm UTC](https://discourse.julialang.org/t/textanalysis-jl-naive-bayes-load-error/45115 "2020-08-17T15:35:56Z")

</div>

I am trying to use TextAnalysis.jl for some text classification using the Naive Bayes Classifier. However, I’ve been unable to begin as I’m getting an error before I can even load the classifier. using TextAnalysis: Nai…

---

## [Turing.jl: DomainError with -960.1841700397322:](https://discourse.julialang.org/t/turing-jl-domainerror-with-960-1841700397322/44829)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 3\
**Last updated:** [August 13, 2020, 9:46am UTC](https://discourse.julialang.org/t/turing-jl-domainerror-with-960-1841700397322/44829 "2020-08-13T09:46:58Z")

</div>

Running the code results in the following error using Turing, ReverseDiff, Memoization Turing.setadbackend(:reversediff) Turing.setrdcache(true) y1 = rand(10) A1 = rand(10, 10) function logsumexp(mat) max\_ = maxi…

---

## [Problem setup for UODE testing](https://discourse.julialang.org/t/problem-setup-for-uode-testing/44422)

<div class="topic-metadata">

**Author:** [@Libbum](https://discourse.julialang.org/u/Libbum)\
**Replies:** 11\
**Last updated:** [August 13, 2020, 8:38am UTC](https://discourse.julialang.org/t/problem-setup-for-uode-testing/44422 "2020-08-13T08:38:33Z")

</div>

Hi all, I’m following these Universal ODE examples, trying to get one of my own systems to work. Having a good deal of issues getting things to solve & I hope someone can see the error I’m making. Problem is that I see…

---

## [Flux in Julia 1.5](https://discourse.julialang.org/t/flux-in-julia-1-5/44428)

<div class="topic-metadata">

**Author:** [@Ruan\_Stander](https://discourse.julialang.org/u/Ruan_Stander)\
**Replies:** 4\
**Last updated:** [August 12, 2020, 10:01am UTC](https://discourse.julialang.org/t/flux-in-julia-1-5/44428 "2020-08-12T10:01:54Z")

</div>

downloaded Julia 1.5 added Flux first time using Flux gives this error Any advice o how to get Flux going on Julia 1.5? julia\> using Flux \[ Info: Precompiling Flux \[587475ba-b771-5e3f-ad9e-33799f191a9c\] Downloading…

---

## [Going beyond MNIST with Flux/Zygote and CUDA and Graph Neural Networks](https://discourse.julialang.org/t/going-beyond-mnist-with-flux-zygote-and-cuda-and-graph-neural-networks/44593)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 4\
**Last updated:** [August 9, 2020, 8:18pm UTC](https://discourse.julialang.org/t/going-beyond-mnist-with-flux-zygote-and-cuda-and-graph-neural-networks/44593 "2020-08-09T20:18:44Z")

</div>

Hi, I normally try to be very specific in titles, but as good practice in some ML communities I am catchy this time. I want to learn more about how ML works in Julia and I worked through some of the examples in Flux’s …

---

## [Specifying loss functions in Flux.jl](https://discourse.julialang.org/t/specifying-loss-functions-in-flux-jl/44586)

<div class="topic-metadata">

**Author:** [@s-baumann](https://discourse.julialang.org/u/s-baumann)\
**Replies:** 8\
**Last updated:** [August 8, 2020, 10:03pm UTC](https://discourse.julialang.org/t/specifying-loss-functions-in-flux-jl/44586 "2020-08-08T22:03:04Z")

</div>

I am trying to write loss functions for use in a simple Neural Network training. As I understand from the documentation loss functions should have the signature loss(ŷ, y). So to my mind something like loss(ŷ, y) = m…

---

## [Dimensions of minibatch](https://discourse.julialang.org/t/dimensions-of-minibatch/44316)

<div class="topic-metadata">

**Author:** [@raoulg](https://discourse.julialang.org/u/raoulg)\
**Replies:** 3\
**Last updated:** [August 7, 2020, 7:41pm UTC](https://discourse.julialang.org/t/dimensions-of-minibatch/44316 "2020-08-07T19:41:40Z")

</div>

I’m sort of struggling with the same issue as here , but the answer isn’t really clear to me. What I’m trying to do is to make a basic timeseries forecasting with a RNN architecture with minibatches. I got the minibatc…

---

## [State of RL packages](https://discourse.julialang.org/t/state-of-rl-packages/44500)

<div class="topic-metadata">

**Author:** [@tbreloff](https://discourse.julialang.org/u/tbreloff)\
**Replies:** 1\
**Last updated:** [August 7, 2020, 2:08pm UTC](https://discourse.julialang.org/t/state-of-rl-packages/44500 "2020-08-07T14:08:23Z")

</div>

Hi all. As many of you know, I’ve been away from the community for a few years, but I was happy to catch up a little with a remote JuliaCon. :tada: I’m wondering if there has been any progress made in the area of Reinf…

---

## [Flux function fitting](https://discourse.julialang.org/t/flux-function-fitting/44475)

<div class="topic-metadata">

**Author:** [@jstrube](https://discourse.julialang.org/u/jstrube)\
**Replies:** 2\
**Last updated:** [August 7, 2020, 1:24pm UTC](https://discourse.julialang.org/t/flux-function-fitting/44475 "2020-08-07T13:24:16Z")

</div>

I’m trying to reproduce the results from this Tensorflow tutorial: The objective is a nonlinear regression. Sounds simple enough, but I’m struggling to reproduce the results from the web page. My attempt looks like thi…

---

## [Problem understanding Loss function behavior using Flux.jl](https://discourse.julialang.org/t/problem-understanding-loss-function-behavior-using-flux-jl/44375)

<div class="topic-metadata">

**Author:** [@german\_brunini](https://discourse.julialang.org/u/german_brunini)\
**Replies:** 5\
**Last updated:** [August 7, 2020, 12:45am UTC](https://discourse.julialang.org/t/problem-understanding-loss-function-behavior-using-flux-jl/44375 "2020-08-07T00:45:44Z")

</div>

First of all, I am new to Neural Network (NN). Now, to the point! As part of my PhD, I am trying to solve some problem through NN. For this, I have created a program that creates some data set made of a collection of…

---

## [Knet: Need Help Generating Minibatches for RNN input](https://discourse.julialang.org/t/knet-need-help-generating-minibatches-for-rnn-input/38169)

<div class="topic-metadata">

**Author:** [@themadprogramer](https://discourse.julialang.org/u/themadprogramer)\
**Replies:** 2\
**Last updated:** [August 6, 2020, 9:59pm UTC](https://discourse.julialang.org/t/knet-need-help-generating-minibatches-for-rnn-input/38169 "2020-08-06T21:59:45Z")

</div>

I’m fairly new to Knet and still trying to figure my way around. The project I’m working on right now is a simple “speech emotion recognizer”. Unfortunately, the RNN tutorial makes for a better introduction to NLP proble…

---

## [Flux model-zoo: Error running vae\_mnist.jl](https://discourse.julialang.org/t/flux-model-zoo-error-running-vae-mnist-jl/44076)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 3\
**Last updated:** [August 3, 2020, 4:52pm UTC](https://discourse.julialang.org/t/flux-model-zoo-error-running-vae-mnist-jl/44076 "2020-08-03T16:52:00Z")

</div>

Hi, I am trying to run the vae\_mnist.jl script from model zoo (https://github.com/FluxML/model-zoo/blob/master/vision/vae\_mnist/vae\_mnist.jl). However, I am getting the following error. ( I use optirun to enable GPU, bu…

---

## [10 min Paper Discussion + Flux Impl.: Towards Learning Convolutions from Scratch](https://discourse.julialang.org/t/10-min-paper-discussion-flux-impl-towards-learning-convolutions-from-scratch/44114)

<div class="topic-metadata">

**Author:** [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Replies:** 0\
**Last updated:** [August 2, 2020, 1:45am UTC](https://discourse.julialang.org/t/10-min-paper-discussion-flux-impl-towards-learning-convolutions-from-scratch/44114 "2020-08-02T01:45:57Z")

</div>

Do we do paper discussions for fun? Figured I’d try it out to see who does CV here and maybe make some new friends. I’m not doing any professional CV work now, did some professionally a few years back, but am getting bac…

---

## [How to define laplacian in Flux or Zygote?](https://discourse.julialang.org/t/how-to-define-laplacian-in-flux-or-zygote/44121)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 0\
**Last updated:** [August 2, 2020, 7:05am UTC](https://discourse.julialang.org/t/how-to-define-laplacian-in-flux-or-zygote/44121 "2020-08-02T07:05:21Z")

</div>

I want to solve a PDE using a neural network and I need to calculate the laplacian of my network.

---

## [Flux - Batch data loop in callback causing GPU Memory Error](https://discourse.julialang.org/t/flux-batch-data-loop-in-callback-causing-gpu-memory-error/33292)

<div class="topic-metadata">

**Author:** [@GdMacmillan](https://discourse.julialang.org/u/GdMacmillan)\
**Replies:** 5\
**Last updated:** [August 1, 2020, 11:15am UTC](https://discourse.julialang.org/t/flux-batch-data-loop-in-callback-causing-gpu-memory-error/33292 "2020-08-01T11:15:53Z")

</div>

I’m trying to build a general tutorial for the basic build of an image classifier in flux on a Colab notebook.. The dataset is Fashion MNIST. Building it out more and more I have found a problem with my code, Recently I…

---

## [Flux: Error when computing gradient of broadcasted ifelse on GPU](https://discourse.julialang.org/t/flux-error-when-computing-gradient-of-broadcasted-ifelse-on-gpu/43907)

<div class="topic-metadata">

**Author:** [@raff](https://discourse.julialang.org/u/raff)\
**Replies:** 1\
**Last updated:** [July 30, 2020, 4:30pm UTC](https://discourse.julialang.org/t/flux-error-when-computing-gradient-of-broadcasted-ifelse-on-gpu/43907 "2020-07-30T16:30:22Z")

</div>

Here is a code example X = rand(3,3) .- 0.4 X = X |\> cu f(X) = sum(ifelse.(X .\> 0, X, 1f0)) gradient(f, X) And here is the error message ERROR: TypeError: non-boolean (ForwardDiff.Dual{Nothing,Bool,3}) used in boolean…

---

## [Inspecting and controlling sckit-learn version in ScikitLearn.jl](https://discourse.julialang.org/t/inspecting-and-controlling-sckit-learn-version-in-scikitlearn-jl/29872)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 4\
**Last updated:** [July 30, 2020, 2:49pm UTC](https://discourse.julialang.org/t/inspecting-and-controlling-sckit-learn-version-in-scikitlearn-jl/29872 "2020-07-30T14:49:13Z")

</div>

How do determine which version of the python library scikit-learn my ScikitLearn.jl installation is using? Is there any way to control which version is used? If not, how is the version installed determined? Does it depen…

---

## [Flux load and save](https://discourse.julialang.org/t/flux-load-and-save/43954)

<div class="topic-metadata">

**Author:** [@Ruan\_Stander](https://discourse.julialang.org/u/Ruan_Stander)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 11:38am UTC](https://discourse.julialang.org/t/flux-load-and-save/43954 "2020-07-30T11:38:46Z")

</div>

Does Flux Load/Save require the same variable name? @save "30x30\_64x64.bson" model @load "30x30\_64x64.bson" model1 Error: Key model1 not found

---

## [Using MLJ with Gaussian Process Regression](https://discourse.julialang.org/t/using-mlj-with-gaussian-process-regression/43883)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 2:00pm UTC](https://discourse.julialang.org/t/using-mlj-with-gaussian-process-regression/43883 "2020-07-29T14:00:01Z")

</div>

I have a data set on which I would like to perform binary classification, and I would like to see how well Gaussian Process Regression (GPR) does with it. Since I’ve already been experimenting with MLJ, I figured I migh…

---

## [UndefVarError: θ not defined](https://discourse.julialang.org/t/undefvarerror-not-defined/43820)

<div class="topic-metadata">

**Author:** [@Irene](https://discourse.julialang.org/u/Irene)\
**Replies:** 7\
**Last updated:** [July 29, 2020, 8:14am UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/43820 "2020-07-29T08:14:43Z")

</div>

Hi, I stumbled upon this very nice example from @SebastianCallh in which Neural ODE are used to model and forecast the weather in the city of Delhi. I have a keen interest in learning how to apply differential equations…

---

## [NeuralODE and ModelingToolkit](https://discourse.julialang.org/t/neuralode-and-modelingtoolkit/43855)

<div class="topic-metadata">

**Author:** [@Jagirhussan](https://discourse.julialang.org/u/Jagirhussan)\
**Replies:** 2\
**Last updated:** [July 29, 2020, 5:07am UTC](https://discourse.julialang.org/t/neuralode-and-modelingtoolkit/43855 "2020-07-29T05:07:31Z")

</div>

I would like to do statespace analysis. ModelingToolkit provides some very useful constructs to do this. I was wondering if there is a way to analyse NeuralODE’s (trained using DiffEqFlux) using ModelingToolkit? Thanks

---

## [Flux: GPU not working as expected](https://discourse.julialang.org/t/flux-gpu-not-working-as-expected/43759)

<div class="topic-metadata">

**Author:** [@Ruan\_Stander](https://discourse.julialang.org/u/Ruan_Stander)\
**Replies:** 6\
**Last updated:** [July 28, 2020, 5:50pm UTC](https://discourse.julialang.org/t/flux-gpu-not-working-as-expected/43759 "2020-07-28T17:50:40Z")

</div>

https://github.com/FluxML/model-zoo/blob/master/vision/mnist/mlp.jl Adapting above example to my own set of inputs. The example works as expected When I change input from 28x28 MNIST pictures to my input ( 10x5 Array{…

---

## [Question about writting custom training function using Flux.jl](https://discourse.julialang.org/t/question-about-writting-custom-training-function-using-flux-jl/43743)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 2\
**Last updated:** [July 28, 2020, 1:27am UTC](https://discourse.julialang.org/t/question-about-writting-custom-training-function-using-flux-jl/43743 "2020-07-28T01:27:02Z")

</div>

Hello, I am trying to write a custom training function instead of using Flux!train, following the documentation https://fluxml.ai/Flux.jl/stable/training/training/#Model-parameters-1, but it will pop up error message “O…

---

## [Unstack-stack-unstack-stack](https://discourse.julialang.org/t/unstack-stack-unstack-stack/43591)

<div class="topic-metadata">

**Author:** [@victorialena](https://discourse.julialang.org/u/victorialena)\
**Replies:** 1\
**Last updated:** [July 25, 2020, 3:45pm UTC](https://discourse.julialang.org/t/unstack-stack-unstack-stack/43591 "2020-07-25T15:45:45Z")

</div>

any ideas on how to make this more efficient? I don’t know how to broadcast the functions more efficiently than a for loop and matrix multiplications in 3D didn’t really work for me. Can someone help? # input has size …

---

## [Apply boolean mask in loss function](https://discourse.julialang.org/t/apply-boolean-mask-in-loss-function/40374)

<div class="topic-metadata">

**Author:** [@dfenn](https://discourse.julialang.org/u/dfenn)\
**Replies:** 1\
**Last updated:** [July 23, 2020, 4:26pm UTC](https://discourse.julialang.org/t/apply-boolean-mask-in-loss-function/40374 "2020-07-23T16:26:15Z")

</div>

Is there a way to apply a boolean mask to the multidimensional arrays in a loss function using Flux? I’ve been unable to achieve this on the gpu. I’m using Julia 1.3 and Flux v0.10.4. Consider the following MWE (this is…

---

## [Interested in using TaylorSeries.jl as an implementation of high-order automatic differentiation / AD , as presented in the book by W. Tucker](https://discourse.julialang.org/t/interested-in-using-taylorseries-jl-as-an-implementation-of-high-order-automatic-differentiation-ad-as-presented-in-the-book-by-w-tucker/43356)

<div class="topic-metadata">

**Author:** [@Marc.Cox](https://discourse.julialang.org/u/Marc.Cox)\
**Replies:** 5\
**Last updated:** [July 20, 2020, 4:08pm UTC](https://discourse.julialang.org/t/interested-in-using-taylorseries-jl-as-an-implementation-of-high-order-automatic-differentiation-ad-as-presented-in-the-book-by-w-tucker/43356 "2020-07-20T16:08:06Z")

</div>

Below is my (initial) solution to an issue I was having with TaylorSeries.jl , which leads to another question \>\> And more generally I’m interested in using TaylorSeries.jl as an implementation of high-order automatic di…

---

## [ForwardDiffSensitivity() and TrackerAdjoint() give different answers](https://discourse.julialang.org/t/forwarddiffsensitivity-and-trackeradjoint-give-different-answers/43254)

<div class="topic-metadata">

**Author:** [@fernando-duarte](https://discourse.julialang.org/u/fernando-duarte)\
**Replies:** 3\
**Last updated:** [July 18, 2020, 10:57pm UTC](https://discourse.julialang.org/t/forwarddiffsensitivity-and-trackeradjoint-give-different-answers/43254 "2020-07-18T22:57:16Z")

</div>

using DiffEqSensitivity, OrdinaryDiffEq, Zygote, StochasticDiffEq # similar to documentation, but out-of-place function fiip(u,p,t) du1 = dx = p\[1\]\*u\[1\] - p\[2\]\*u\[1\]\*u\[2\] du2 = dy = -p\[3\]\*u\[2\] + p\[4\]\*u\[1\]\*u\[2\] ret…

---

## [\[ANN\] Announcing Torch.jl](https://discourse.julialang.org/t/ann-announcing-torch-jl/42390)

<div class="topic-metadata">

**Author:** [@dhairyagandhi96](https://discourse.julialang.org/u/dhairyagandhi96)\
**Replies:** 14\
**Last updated:** [July 17, 2020, 6:59pm UTC](https://discourse.julialang.org/t/ann-announcing-torch-jl/42390 "2020-07-17T18:59:14Z")

</div>

I am excited to share some new development in the Julia ML stack. We are announcing Torch.jl which wraps the existing PyTorch and its CUDA kernels and makes them available through Julia. Torch.jl also exposes the kernels…

---

## [A package/example for a simple neural network?](https://discourse.julialang.org/t/a-package-example-for-a-simple-neural-network/43007)

<div class="topic-metadata">

**Author:** [@zxjroger](https://discourse.julialang.org/u/zxjroger)\
**Replies:** 4\
**Last updated:** [July 17, 2020, 8:41am UTC](https://discourse.julialang.org/t/a-package-example-for-a-simple-neural-network/43007 "2020-07-17T08:41:06Z")

</div>

I try to find an easy-to-use package or example for training a forward-feed single-layer neural network. In R, the neuralnet and nnet packages are easy to use for a layman like me. But, I couldn’t find an equivalent pack…

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

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