# Machine Learning

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

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

**Page:** 45

---

## [Essential tools for neural network based PDE solvers](https://discourse.julialang.org/t/essential-tools-for-neural-network-based-pde-solvers/37149)

<div class="topic-metadata">

**Author:** [@leonexu](https://discourse.julialang.org/u/leonexu)\
**Replies:** 7\
**Last updated:** [April 21, 2020, 10:09pm UTC](https://discourse.julialang.org/t/essential-tools-for-neural-network-based-pde-solvers/37149 "2020-04-21T22:09:24Z")

</div>

Chris’s post The Essential Tools of Scientific Machine Learning discussed several tools that are “essential for scientific machine learning” including probabilistic programming, structured linear algebra, discretizing pa…

---

## [How to put a derivative into loss function?](https://discourse.julialang.org/t/how-to-put-a-derivative-into-loss-function/37961)

<div class="topic-metadata">

**Author:** [@vavrines](https://discourse.julialang.org/u/vavrines)\
**Replies:** 1\
**Last updated:** [April 21, 2020, 3:58pm UTC](https://discourse.julialang.org/t/how-to-put-a-derivative-into-loss-function/37961 "2020-04-21T15:58:53Z")

</div>

Hi there, I wonder now if there is a convenient way to put the derivatives from AD into loss function directly. I tried the following code, but it failed with Zygote. using Flux m = Chain(Dense(1, 20, tanh), Dense(20…

---

## [ERROR: MethodError: no method matching \*(::Array{Float32,2}, ::Array{Float32,4})](https://discourse.julialang.org/t/error-methoderror-no-method-matching-array-float32-2-array-float32-4/37906)

<div class="topic-metadata">

**Author:** [@B0001](https://discourse.julialang.org/u/B0001)\
**Replies:** 0\
**Last updated:** [April 20, 2020, 3:38pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-array-float32-2-array-float32-4/37906 "2020-04-20T15:38:10Z")

</div>

I receive the above error when running the following on Julia 1.4.0 and 1.4.1: using Flux x = rand(Float32, 2, 2, 256, 10) Dense(256, 2)(x)

---

## [Speech-based Emotion Recognition](https://discourse.julialang.org/t/speech-based-emotion-recognition/37846)

<div class="topic-metadata">

**Author:** [@themadprogramer](https://discourse.julialang.org/u/themadprogramer)\
**Replies:** 1\
**Last updated:** [April 19, 2020, 1:32pm UTC](https://discourse.julialang.org/t/speech-based-emotion-recognition/37846 "2020-04-19T13:32:51Z")

</div>

Hello, I wasn’t able to find any package for Speech-based Mood/Emotion recognition to use in a project I’m working on, so I need some help setting up something myself. I know that LSTM’s are in use for this, I’ve seen …

---

## [Help to improve performance of gradient calculation on tensor operations](https://discourse.julialang.org/t/help-to-improve-performance-of-gradient-calculation-on-tensor-operations/37773)

<div class="topic-metadata">

**Author:** [@sjrodahl](https://discourse.julialang.org/u/sjrodahl)\
**Replies:** 3\
**Last updated:** [April 18, 2020, 8:14pm UTC](https://discourse.julialang.org/t/help-to-improve-performance-of-gradient-calculation-on-tensor-operations/37773 "2020-04-18T20:14:18Z")

</div>

I need help improving the performance of gradient calculation of a piece of my program, and understanding why it is performing as it does. As part of a larger machine learning system, I need a pairwise similarity measur…

---

## [RayTracer.jl a differentiable ray tracer](https://discourse.julialang.org/t/raytracer-jl-a-differentiable-ray-tracer/26527)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 29\
**Last updated:** [April 15, 2020, 6:25pm UTC](https://discourse.julialang.org/t/raytracer-jl-a-differentiable-ray-tracer/26527 "2020-04-15T18:25:03Z")

</div>

I am really enthused by @ChrisRackauckas tweets about ScientificAI, the new paper and JuliaCon. I guess the answer is ‘go to JuliaCon’’ - which sadly I cannot. @avikpal paper on RayTracer.jl caught my eye. Please could…

---

## [Reddit discussion: limitations of Zygote](https://discourse.julialang.org/t/reddit-discussion-limitations-of-zygote/36982)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 15\
**Last updated:** [April 14, 2020, 9:12am UTC](https://discourse.julialang.org/t/reddit-discussion-limitations-of-zygote/36982 "2020-04-14T09:12:09Z")

</div>

There is a reddit discussion of the swift/tensorflow project that has a couple comments about Julia. I am interested in this statement - to what extent is this true? If the end goal is to “differentiate all the things…

---

## [Possible anonymous function bug in Flux](https://discourse.julialang.org/t/possible-anonymous-function-bug-in-flux/26389)

<div class="topic-metadata">

**Author:** [@stu](https://discourse.julialang.org/u/stu)\
**Replies:** 9\
**Last updated:** [April 14, 2020, 5:49am UTC](https://discourse.julialang.org/t/possible-anonymous-function-bug-in-flux/26389 "2020-04-14T05:49:07Z")

</div>

Has anyone noticed that m = Chain(Dense(5, 2), Dense(2, 2) Dense(2, 5)) produces an entirely result than m = Chain(x -\> Dense(5, 2)(x), Dense(2, 2) Dense(2, 5)) are anonymous functions somehow not supported for Chain…

---

## [Generic Function to train NN w/ Flux](https://discourse.julialang.org/t/generic-function-to-train-nn-w-flux/37208)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 7\
**Last updated:** [April 14, 2020, 3:47am UTC](https://discourse.julialang.org/t/generic-function-to-train-nn-w-flux/37208 "2020-04-14T03:47:30Z")

</div>

Updated: I would like to write a generic function to train a model in Flux. An ordinary linear regression w/ intercept is a special case of a neural network. If the optimizers work well I should get the same result (es…

---

## [ML for optimal power flow](https://discourse.julialang.org/t/ml-for-optimal-power-flow/37501)

<div class="topic-metadata">

**Author:** [@Mariana](https://discourse.julialang.org/u/Mariana)\
**Replies:** 0\
**Last updated:** [April 13, 2020, 11:53am UTC](https://discourse.julialang.org/t/ml-for-optimal-power-flow/37501 "2020-04-13T11:53:24Z")

</div>

I’d like to use neural networks to estimate some variable on an optimal power flow problem. For example, I’d like to estimate the power flow on transmission lines, given the system topology (generation, demand, line para…

---

## [Tanmay Bakshi tried to teach me ML, but I failed and I don't know why](https://discourse.julialang.org/t/tanmay-bakshi-tried-to-teach-me-ml-but-i-failed-and-i-dont-know-why/37415)

<div class="topic-metadata">

**Author:** [@Klaus](https://discourse.julialang.org/u/Klaus)\
**Replies:** 4\
**Last updated:** [April 12, 2020, 1:39pm UTC](https://discourse.julialang.org/t/tanmay-bakshi-tried-to-teach-me-ml-but-i-failed-and-i-dont-know-why/37415 "2020-04-12T13:39:08Z")

</div>

I tried this code snippet from the book (…springboard to machine learning for all ages): using Metalhead: VGG19, preprocess, load, labels using Flux: onecold model = VGG19() class\_labels = labels(model) print("Enter t…

---

## [Best flux for Tracker: 0.9 or 0.8.3?](https://discourse.julialang.org/t/best-flux-for-tracker-0-9-or-0-8-3/37143)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 3:08am UTC](https://discourse.julialang.org/t/best-flux-for-tracker-0-9-or-0-8-3/37143 "2020-04-11T03:08:31Z")

</div>

A post in this recent discussion recommends using Tracker rather than Zygote if one is less adventurous. I am undecided, but, if one is to use Tracker, which version of Flux is best?

---

## [Sokoban and Julia](https://discourse.julialang.org/t/sokoban-and-julia/37227)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 2\
**Last updated:** [April 9, 2020, 8:47am UTC](https://discourse.julialang.org/t/sokoban-and-julia/37227 "2020-04-09T08:47:08Z")

</div>

Hi, just for a curiosity, did played with reinforcement learning to solve sokoban? Is there any repo, which would allow to play with it? Thanks for response, Tomas

---

## [\[ANN\] AdversarialPrediction.jl | Easily optimize generic performance metrics in differentiable learning](https://discourse.julialang.org/t/ann-adversarialprediction-jl-easily-optimize-generic-performance-metrics-in-differentiable-learning/31804)

<div class="topic-metadata">

**Author:** [@raff](https://discourse.julialang.org/u/raff)\
**Replies:** 1\
**Last updated:** [April 8, 2020, 1:23pm UTC](https://discourse.julialang.org/t/ann-adversarialprediction-jl-easily-optimize-generic-performance-metrics-in-differentiable-learning/31804 "2020-04-08T13:23:05Z")

</div>

I am excited to announce a new approach for optimizing generic performance metrics (including non-decomposable metrics) in differentiable learning. AdversarialPrediction.jl provides a Julia implementation of the framewor…

---

## [In Flux0.10.4 Warning: Zygote does not have CuArrays in its dependencies](https://discourse.julialang.org/t/in-flux0-10-4-warning-zygote-does-not-have-cuarrays-in-its-dependencies/37142)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [April 7, 2020, 8:03am UTC](https://discourse.julialang.org/t/in-flux0-10-4-warning-zygote-does-not-have-cuarrays-in-its-dependencies/37142 "2020-04-07T08:03:11Z")

</div>

from a fresh Julia1.4, adding the new Flux 0.10.4, followed by adding Zygote, results in a warning Package Zygote does not have CuArrays in its dependencies …you may need to report an issue with Zygote. Is this som…

---

## [Model zoo housing.jl - out of date use of Flux.Tracker?](https://discourse.julialang.org/t/model-zoo-housing-jl-out-of-date-use-of-flux-tracker/37144)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 0\
**Last updated:** [April 7, 2020, 5:12am UTC](https://discourse.julialang.org/t/model-zoo-housing-jl-out-of-date-use-of-flux-tracker/37144 "2020-04-07T05:12:50Z")

</div>

The model-zoo/other/housing/ housing.jl is importing Flux.Tracker. Does this mean the example is out-of-date, or does Tracker still work with the current 0.10.x versions of Flux? (My impression was that Tracker does no…

---

## [After adding Flux package, why is it necessary to also add Zygote](https://discourse.julialang.org/t/after-adding-flux-package-why-is-it-necessary-to-also-add-zygote/36983)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 8\
**Last updated:** [April 7, 2020, 5:02am UTC](https://discourse.julialang.org/t/after-adding-flux-package-why-is-it-necessary-to-also-add-zygote/36983 "2020-04-07T05:02:16Z")

</div>

This is a beginner/tooling question about packages, but if I post it there people will not know the particular packages. The question: I want to use Zygote.@nograd, so I put using Zygote however this says that it is …

---

## [Gradients of custom functions with Flux](https://discourse.julialang.org/t/gradients-of-custom-functions-with-flux/37041)

<div class="topic-metadata">

**Author:** [@snisher](https://discourse.julialang.org/u/snisher)\
**Replies:** 2\
**Last updated:** [April 5, 2020, 4:46pm UTC](https://discourse.julialang.org/t/gradients-of-custom-functions-with-flux/37041 "2020-04-05T16:46:23Z")

</div>

Hi, I’m trying to implement MAML, but I’m getting an error when calculating a gradient using Flux. The error occurs when trying to get the gradient of another function, inner\_loop. Some research indicates this is an out…

---

## [Why does Pkg.update() downgrade from Flux0.10 to 0.8?](https://discourse.julialang.org/t/why-does-pkg-update-downgrade-from-flux0-10-to-0-8/37043)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 1\
**Last updated:** [April 5, 2020, 8:14am UTC](https://discourse.julialang.org/t/why-does-pkg-update-downgrade-from-flux0-10-to-0-8/37043 "2020-04-05T08:14:21Z")

</div>

Hello I just installed julia1.4 (mac), and was installing needed packages. From previous experience, I know that the thing to do is install Flux first, then install other packages, that way it will select compatible pa…

---

## [Standardize dataset with StatsBase](https://discourse.julialang.org/t/standardize-dataset-with-statsbase/37034)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 1\
**Last updated:** [April 4, 2020, 8:00pm UTC](https://discourse.julialang.org/t/standardize-dataset-with-statsbase/37034 "2020-04-04T20:00:00Z")

</div>

Hi, I am trying to apply this standardization scheme where you standardize the test set on the base of the train set. I am trying to do this with the ZScoreTransform of StatsBase, but I encounter this trouble. # usin…

---

## [Flux custom layers - incorrect solution from training](https://discourse.julialang.org/t/flux-custom-layers-incorrect-solution-from-training/36993)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 0\
**Last updated:** [April 3, 2020, 11:21pm UTC](https://discourse.julialang.org/t/flux-custom-layers-incorrect-solution-from-training/36993 "2020-04-03T23:21:20Z")

</div>

My real goal is to include layers with matrices computed from known physics solutions; the training will then determine physical parameters appearing in the equations used to compute the matrix elements. To get started,…

---

## [Understand this part of the Zygote docs](https://discourse.julialang.org/t/understand-this-part-of-the-zygote-docs/36816)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [April 3, 2020, 8:24pm UTC](https://discourse.julialang.org/t/understand-this-part-of-the-zygote-docs/36816 "2020-04-03T20:24:32Z")

</div>

I am wondering if there are several typos in introduction example to custom adjoints, https://fluxml.ai/Zygote.jl/dev/adjoints/ In other words pullback(sin, x) behaves the same as dsin(x) = sin(x), ȳ -\> (ȳ \* cos(x)…

---

## [Matrix formulation of multiple regression](https://discourse.julialang.org/t/matrix-formulation-of-multiple-regression/33358)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [April 3, 2020, 4:56pm UTC](https://discourse.julialang.org/t/matrix-formulation-of-multiple-regression/33358 "2020-04-03T16:56:52Z")

</div>

I’ve been studying linear algebra and I decided I would see what it takes to code a multiple regression model from scratch to deepen my understanding of some of the things I’ve been learning. I couldn’t really find any J…

---

## [Zygote custom adjoint has surprising performance effects](https://discourse.julialang.org/t/zygote-custom-adjoint-has-surprising-performance-effects/36972)

<div class="topic-metadata">

**Author:** [@SEA](https://discourse.julialang.org/u/SEA)\
**Replies:** 0\
**Last updated:** [April 3, 2020, 3:26pm UTC](https://discourse.julialang.org/t/zygote-custom-adjoint-has-surprising-performance-effects/36972 "2020-04-03T15:26:03Z")

</div>

I am experimenting with custom adjoints in Zygote. In the following code, I defined an adjoint for the function gauss. Surprisingly, benchmarking gradient on gauss and a “wrapper” closure f around gauss shows that the gr…

---

## [Zygote: meaning of @adjoint add(a, b) = add(a, b), Δ -\> (Δ, Δ)](https://discourse.julialang.org/t/zygote-meaning-of-adjoint-add-a-b-add-a-b/36707)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 4\
**Last updated:** [March 31, 2020, 11:18pm UTC](https://discourse.julialang.org/t/zygote-meaning-of-adjoint-add-a-b-add-a-b/36707 "2020-03-31T23:18:52Z")

</div>

The zygote landing page has the example @adjoint add(a, b) = add(a, b), Δ -\> (Δ, Δ) Can someone explain what the Δ -\> (Δ, Δ) means? I would have expected the derivatives to be 1,1.

---

## [Zygote docs suggest flux is out of date?](https://discourse.julialang.org/t/zygote-docs-suggest-flux-is-out-of-date/36706)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 0\
**Last updated:** [March 29, 2020, 11:14pm UTC](https://discourse.julialang.org/t/zygote-docs-suggest-flux-is-out-of-date/36706 "2020-03-29T23:14:26Z")

</div>

In the zygote docs it says However, implicit parameters exist mainly for compatibility with Flux’s current AD; it’s recommended to use the other approaches unless you need this, where implicit parameters refer to the s…

---

## [Is there a way to speed up this implementation of BLSTM layer?](https://discourse.julialang.org/t/is-there-a-way-to-speed-up-this-implementation-of-blstm-layer/36429)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 1\
**Last updated:** [March 28, 2020, 11:00am UTC](https://discourse.julialang.org/t/is-there-a-way-to-speed-up-this-implementation-of-blstm-layer/36429 "2020-03-28T11:00:46Z")

</div>

I have implemented the BLSTM layer for a batch of sequences input stored as a 3D array with dimensions ordered as \[features × time × batch\]. And I wonder if there is a faster way to implement it. I’m interested in the sp…

---

## [How to get reproducible results of classification models?: example using DecisionTree](https://discourse.julialang.org/t/how-to-get-reproducible-results-of-classification-models-example-using-decisiontree/36452)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 0\
**Last updated:** [March 24, 2020, 3:12pm UTC](https://discourse.julialang.org/t/how-to-get-reproducible-results-of-classification-models-example-using-decisiontree/36452 "2020-03-24T15:12:55Z")

</div>

Hi! I would like to train a classifier (eg. Random Forests) and I would like to get the same results if I train/run the model again. My first attempt was to try to set the seed of the random number generator, like this: …

---

## [StackOverflowError in Bayesian Neural Networks Tutorial](https://discourse.julialang.org/t/stackoverflowerror-in-bayesian-neural-networks-tutorial/36372)

<div class="topic-metadata">

**Author:** [@Farlein](https://discourse.julialang.org/u/Farlein)\
**Replies:** 5\
**Last updated:** [March 24, 2020, 12:35pm UTC](https://discourse.julialang.org/t/stackoverflowerror-in-bayesian-neural-networks-tutorial/36372 "2020-03-24T12:35:41Z")

</div>

Hi there, I am learning Bayesian Neural Networks (BNN) using Turing. I have copied the codes from the tutorial, https://turing.ml/dev/tutorials/3-bayesnn/. The original code trains a BNN model with a synthetic dataset …

---

## [Simple tool for train test split](https://discourse.julialang.org/t/simple-tool-for-train-test-split/473)

<div class="topic-metadata">

**Author:** [@klezmen](https://discourse.julialang.org/u/klezmen)\
**Replies:** 12\
**Last updated:** [March 20, 2020, 1:09am UTC](https://discourse.julialang.org/t/simple-tool-for-train-test-split/473 "2020-03-20T01:09:54Z")

</div>

Does anyone know a tool that enables me to split a dataframe in to a training set and a test set?

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

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