# Machine Learning

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

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

**Page:** 37

---

## [Anyone has implemented Kernel SVD in this ICLR 2019 paper?](https://discourse.julialang.org/t/anyone-has-implemented-kernel-svd-in-this-iclr-2019-paper/56780)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 0\
**Last updated:** [March 9, 2021, 2:52am UTC](https://discourse.julialang.org/t/anyone-has-implemented-kernel-svd-in-this-iclr-2019-paper/56780 "2021-03-09T02:52:15Z")

</div>

Hello experts, recently I am trying out Flux.jl to initiate a research project on ML. I quickly ran into the issue of network compression and knowledge distillation. I have a background in physics and I have heard about…

---

## [ARDRegression function?](https://discourse.julialang.org/t/ardregression-function/56620)

<div class="topic-metadata">

**Author:** [@casv2](https://discourse.julialang.org/u/casv2)\
**Replies:** 2\
**Last updated:** [March 6, 2021, 4:37pm UTC](https://discourse.julialang.org/t/ardregression-function/56620 "2021-03-06T16:37:59Z")

</div>

I’m wondering whether there’s a native Julia “ARDRegression” (linear model regression with an ARD prior) available in a native Julia package somewhere. I haven’t been able to find any, and am having to call sklearn throu…

---

## [Error when getting grads of an ensemble simulation with the newest packages](https://discourse.julialang.org/t/error-when-getting-grads-of-an-ensemble-simulation-with-the-newest-packages/56019)

<div class="topic-metadata">

**Author:** [@MikeKlocCZ](https://discourse.julialang.org/u/MikeKlocCZ)\
**Replies:** 2\
**Last updated:** [March 4, 2021, 9:11am UTC](https://discourse.julialang.org/t/error-when-getting-grads-of-an-ensemble-simulation-with-the-newest-packages/56019 "2021-03-04T09:11:12Z")

</div>

Hello everyone, I updated to the newest packages of Zygote and Flux and I get error apparently related to the paralelization of an ensemble simulation using DifferentialEquations, Flux, DiffEqFlux using DiffEqSensiti…

---

## [Lilith.jl is now called Avalon.jl](https://discourse.julialang.org/t/lilith-jl-is-now-called-avalon-jl/51621)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 31\
**Last updated:** [March 3, 2021, 7:08pm UTC](https://discourse.julialang.org/t/lilith-jl-is-now-called-avalon-jl/51621 "2021-03-03T19:08:47Z")

</div>

You know this moment when you realize you made a mistake. When registration to a flight ends in 5 minutes and you find yourself in a wrong terminal. Or its the first day at a new job and you understand they don’t have fr…

---

## [Flux unroll](https://discourse.julialang.org/t/flux-unroll/56355)

<div class="topic-metadata">

**Author:** [@Ul44rich](https://discourse.julialang.org/u/Ul44rich)\
**Replies:** 1\
**Last updated:** [March 2, 2021, 7:01pm UTC](https://discourse.julialang.org/t/flux-unroll/56355 "2021-03-02T19:01:17Z")

</div>

Need hints: Flux “unroll not defined” Thanks

---

## [Tell Flux not to differentiate something](https://discourse.julialang.org/t/tell-flux-not-to-differentiate-something/56253)

<div class="topic-metadata">

**Author:** [@Michaela\_Maskova](https://discourse.julialang.org/u/Michaela_Maskova)\
**Replies:** 8\
**Last updated:** [March 2, 2021, 8:41am UTC](https://discourse.julialang.org/t/tell-flux-not-to-differentiate-something/56253 "2021-03-02T08:41:42Z")

</div>

Hi, I’m trying to create a model using Flux. The model is quite complicated (it builds on Normalizing Flows, RealNVP) and uses many layers on top of each other. There are two inputs - vector Z and matrix X. X is transfo…

---

## [Losses for parameter estimation of Neural SDE](https://discourse.julialang.org/t/losses-for-parameter-estimation-of-neural-sde/50771)

<div class="topic-metadata">

**Author:** [@jlmaccal](https://discourse.julialang.org/u/jlmaccal)\
**Replies:** 15\
**Last updated:** [March 1, 2021, 10:30pm UTC](https://discourse.julialang.org/t/losses-for-parameter-estimation-of-neural-sde/50771 "2021-03-01T22:30:07Z")

</div>

I’m trying to understand the various options for doing parameter estimation on a USDE. I’m completely new to parameter estimation in SDEs, so ELI-dumb-chemist would be appreciated. Background I’m trying to model a physi…

---

## [Does sciml\_train require ensemble to collect MSE of monte carlo solves when connected to a neural network or can I do it with a for loop?](https://discourse.julialang.org/t/does-sciml-train-require-ensemble-to-collect-mse-of-monte-carlo-solves-when-connected-to-a-neural-network-or-can-i-do-it-with-a-for-loop/56171)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 5\
**Last updated:** [March 1, 2021, 3:19pm UTC](https://discourse.julialang.org/t/does-sciml-train-require-ensemble-to-collect-mse-of-monte-carlo-solves-when-connected-to-a-neural-network-or-can-i-do-it-with-a-for-loop/56171 "2021-03-01T15:19:32Z")

</div>

General diffeqflux question. I have a diffeq simulation using DifferentialEquations.jl and solve that works fine by itself. I want to prepend the outputs of a neural network to the solution setup so when trained, it wo…

---

## [Save and Load Random Forest trained with MLJ/ScikitLearn.jl](https://discourse.julialang.org/t/save-and-load-random-forest-trained-with-mlj-scikitlearn-jl/55798)

<div class="topic-metadata">

**Author:** [@rio](https://discourse.julialang.org/u/rio)\
**Replies:** 4\
**Last updated:** [March 1, 2021, 2:08pm UTC](https://discourse.julialang.org/t/save-and-load-random-forest-trained-with-mlj-scikitlearn-jl/55798 "2021-03-01T14:08:25Z")

</div>

I would like to train a Random Forest model (RandomForestRegressor pkg=ScikitLearn) and save the trained model to disk. Then, I would like to load the model and apply it to new data. After training with success, I tried…

---

## [Flux: Embeddings on GPU](https://discourse.julialang.org/t/flux-embeddings-on-gpu/55280)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 5\
**Last updated:** [February 28, 2021, 7:17pm UTC](https://discourse.julialang.org/t/flux-embeddings-on-gpu/55280 "2021-02-28T19:17:57Z")

</div>

In a regression model I would like to use embeddings for the categorical variables. My current implementation is like the simplified example below. On CPU it works seemingly fine. Any suggestions for improvement are welc…

---

## [Hessian inside a Flux loss function](https://discourse.julialang.org/t/hessian-inside-a-flux-loss-function/56043)

<div class="topic-metadata">

**Author:** [@arlk](https://discourse.julialang.org/u/arlk)\
**Replies:** 3\
**Last updated:** [February 26, 2021, 4:21pm UTC](https://discourse.julialang.org/t/hessian-inside-a-flux-loss-function/56043 "2021-02-26T16:21:50Z")

</div>

MWE (or as minimal as I can think to make it): using Flux import ForwardDiff, Zygote g = Dense(2, 1, softplus) loss(m, x) = sum(abs2, Zygote.hessian(x-\>sum(m(x)), x)) gradient(g, rand(2)) do m, x loss(m, x) end Bot…

---

## [How to enforce weight matrix to be of a certain form (train a subset) in Flux?](https://discourse.julialang.org/t/how-to-enforce-weight-matrix-to-be-of-a-certain-form-train-a-subset-in-flux/33197)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 5\
**Last updated:** [February 26, 2021, 3:02pm UTC](https://discourse.julialang.org/t/how-to-enforce-weight-matrix-to-be-of-a-certain-form-train-a-subset-in-flux/33197 "2021-02-26T15:02:03Z")

</div>

For example, I want a layer specified by a symmetric or a tridiagonal matrix. Obviously, train! does not know about it, and an error is raised: ArgumentError: cannot set entry (3, 1) off the tridiagonal band to a nonzer…

---

## [How to create a MLJModelInterface.Model interface of a complex model?](https://discourse.julialang.org/t/how-to-create-a-mljmodelinterface-model-interface-of-a-complex-model/55860)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [February 25, 2021, 10:26am UTC](https://discourse.julialang.org/t/how-to-create-a-mljmodelinterface-model-interface-of-a-complex-model/55860 "2021-02-25T10:26:19Z")

</div>

Hi there, I am trying to build a MLJ interface for some ML algorithms in the BetaML package. I am starting from the Decision Trees, but I have a few questions. The function creating (and fitting) the tree is: buildTr…

---

## [What is the difference between Zygote vs ForwardDiff and ReverseDiff](https://discourse.julialang.org/t/what-is-the-difference-between-zygote-vs-forwarddiff-and-reversediff/55789)

<div class="topic-metadata">

**Author:** [@qft](https://discourse.julialang.org/u/qft)\
**Replies:** 4\
**Last updated:** [February 23, 2021, 11:27pm UTC](https://discourse.julialang.org/t/what-is-the-difference-between-zygote-vs-forwarddiff-and-reversediff/55789 "2021-02-23T23:27:28Z")

</div>

As far as I can tell from the documentation, both ForwardDiff and ReverseDiff can already do automatic differentiation on arbitrary Julia functions. Also Zygote depends on ForwardDiff. What unique feature does Zygote bri…

---

## [\[GSoC 2021\] Few Shot Learning Algorithms](https://discourse.julialang.org/t/gsoc-2021-few-shot-learning-algorithms/48861)

<div class="topic-metadata">

**Author:** [@rakesh4real](https://discourse.julialang.org/u/rakesh4real)\
**Replies:** 2\
**Last updated:** [February 21, 2021, 9:35pm UTC](https://discourse.julialang.org/t/gsoc-2021-few-shot-learning-algorithms/48861 "2021-02-21T21:35:14Z")

</div>

Hi, I want to work on a long-term project in few shot learning algorithms encompassing various techniques and architectures ranging from siamese networks to neural turing machines to meta-learners in Julia for at least 2…

---

## [Flux: Locally connected layer performance](https://discourse.julialang.org/t/flux-locally-connected-layer-performance/55711)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 2\
**Last updated:** [February 21, 2021, 7:34pm UTC](https://discourse.julialang.org/t/flux-locally-connected-layer-performance/55711 "2021-02-21T19:34:20Z")

</div>

I have tried to implement a 2D locally connected layer (convolution with non-shared weights) in Flux restricted to filter size (1,1) only. That is, the linear combinations/convolutions are only over the (3rd) channel/var…

---

## [Flux VAE on the iris dataset](https://discourse.julialang.org/t/flux-vae-on-the-iris-dataset/55657)

<div class="topic-metadata">

**Author:** [@rsteckel](https://discourse.julialang.org/u/rsteckel)\
**Replies:** 2\
**Last updated:** [February 20, 2021, 12:35am UTC](https://discourse.julialang.org/t/flux-vae-on-the-iris-dataset/55657 "2021-02-20T00:35:12Z")

</div>

I’ve been stuck trying to get a variational autoencoder working using Flux. I’ve tried to adapt the mnist VAE in Flux’s model zoo (which I could not get to work either) to the iris data set. Here’s my code so far: usin…

---

## [Understanding the performance of Zygote](https://discourse.julialang.org/t/understanding-the-performance-of-zygote/55447)

<div class="topic-metadata">

**Author:** [@Himanshu\_Chaudhary](https://discourse.julialang.org/u/Himanshu_Chaudhary)\
**Replies:** 1\
**Last updated:** [February 18, 2021, 10:37am UTC](https://discourse.julialang.org/t/understanding-the-performance-of-zygote/55447 "2021-02-18T10:37:27Z")

</div>

I remember reading somewhere that the cost of automatic differentiation is usually less than 2 times the cost of evaluating the function itself. I tried to benchmark a small code and the results that I got were a little…

---

## [Gradient of sum](https://discourse.julialang.org/t/gradient-of-sum/55389)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [February 16, 2021, 12:06pm UTC](https://discourse.julialang.org/t/gradient-of-sum/55389 "2021-02-16T12:06:39Z")

</div>

T = randn(10,10) ps = Flux.params(T) opt=ADAM() for iter = 1:100 gs = gradient(ps) do sum(T) end Flux.update!(opt, ps, gs) end throws an error: ArgumentError: Cannot setindex! to 0.00099999999000000…

---

## [Wrapping a simple R package](https://discourse.julialang.org/t/wrapping-a-simple-r-package/55349)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 2\
**Last updated:** [February 16, 2021, 4:47am UTC](https://discourse.julialang.org/t/wrapping-a-simple-r-package/55349 "2021-02-16T04:47:37Z")

</div>

I want to wrap a simple ML package: sprintr. In R the code is straight-forward: library(sprintr); m = cv.sprinter(x = X, y = y) pred = predict(m, newdata = XH) In Julia it works in 1-step: X = randn(100,5) y = 7.0 .…

---

## [This file wont precompile](https://discourse.julialang.org/t/this-file-wont-precompile/55362)

<div class="topic-metadata">

**Author:** [@DevJac](https://discourse.julialang.org/u/DevJac)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 11:38pm UTC](https://discourse.julialang.org/t/this-file-wont-precompile/55362 "2021-02-15T23:38:35Z")

</div>

using Flux using Statistics using Networks export PolicyNetwork, advantage ... I have this source file in the src directory of my project. src is in the JULIA\_LOAD\_PATH, but when I attempt to use Networks Julia pre-c…

---

## [Apply Flux model to a matrix](https://discourse.julialang.org/t/apply-flux-model-to-a-matrix/55324)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 0\
**Last updated:** [February 15, 2021, 3:18pm UTC](https://discourse.julialang.org/t/apply-flux-model-to-a-matrix/55324 "2021-02-15T15:18:26Z")

</div>

I have a program that outputs a matrix and I have also a NN model that takes as input one element array. I want to apply the NN to every element of the matrix. I have tried in this way my\_model(x) = reshape(reshape(x,…

---

## [Flux train multiple models at the same time](https://discourse.julialang.org/t/flux-train-multiple-models-at-the-same-time/55154)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 1\
**Last updated:** [February 14, 2021, 9:47am UTC](https://discourse.julialang.org/t/flux-train-multiple-models-at-the-same-time/55154 "2021-02-14T09:47:48Z")

</div>

What is the best way to train multiple NN models on the same data at the same time? Thank you

---

## [Different behaviour between Flux.jl and Pytorch](https://discourse.julialang.org/t/different-behaviour-between-flux-jl-and-pytorch/54941)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 17\
**Last updated:** [February 13, 2021, 8:24am UTC](https://discourse.julialang.org/t/different-behaviour-between-flux-jl-and-pytorch/54941 "2021-02-13T08:24:21Z")

</div>

I am trying to generate the results of this paper https://arxiv.org/abs/1808.03856. I have created two similar models using Flux.jl and Pytorch. There is no equivalence to pytorch.gather function in Flux.jl, so I create…

---

## [How do Julia packages, e.g. Flux and Knet correspond to Python ecosystem](https://discourse.julialang.org/t/how-do-julia-packages-e-g-flux-and-knet-correspond-to-python-ecosystem/55147)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [February 12, 2021, 8:09pm UTC](https://discourse.julialang.org/t/how-do-julia-packages-e-g-flux-and-knet-correspond-to-python-ecosystem/55147 "2021-02-12T20:09:40Z")

</div>

I’m not so much asking if they are better, just some mapping, and trying to get an overview of the mainstream and where there might be big holes in the Julia ecosystem. E.g. Pytorch Lightning corresponds to Keras, and t…

---

## [Jacobian of NN: Mutating arrays is not supported](https://discourse.julialang.org/t/jacobian-of-nn-mutating-arrays-is-not-supported/55053)

<div class="topic-metadata">

**Author:** [@Sunny](https://discourse.julialang.org/u/Sunny)\
**Replies:** 2\
**Last updated:** [February 11, 2021, 2:20pm UTC](https://discourse.julialang.org/t/jacobian-of-nn-mutating-arrays-is-not-supported/55053 "2021-02-11T14:20:08Z")

</div>

I’m trying to take derivative of the jacobian of neural network. But there emerges mutating arrays problem nn = Chain(Dense(2,10, tanh), Dense(10,1)) println(Flux.params(nn)) jac₁ = x -\> ForwardDiff.jacobian(nn, x) # w…

---

## [Flux: get intermediate results per epoch](https://discourse.julialang.org/t/flux-get-intermediate-results-per-epoch/55011)

<div class="topic-metadata">

**Author:** [@ZettEff](https://discourse.julialang.org/u/ZettEff)\
**Replies:** 4\
**Last updated:** [February 11, 2021, 6:49am UTC](https://discourse.julialang.org/t/flux-get-intermediate-results-per-epoch/55011 "2021-02-11T06:49:13Z")

</div>

Hello, how do you access (or store) intermediate results such as weights per epoch in Flux? I have today started using it and was really surprised by how easy it is to implement thing. One thing I did not find and could…

---

## [What is the relation between MLJ and Flux?](https://discourse.julialang.org/t/what-is-the-relation-between-mlj-and-flux/32680)

<div class="topic-metadata">

**Author:** [@yuxi.liu](https://discourse.julialang.org/u/yuxi.liu)\
**Replies:** 17\
**Last updated:** [February 10, 2021, 11:57pm UTC](https://discourse.julialang.org/t/what-is-the-relation-between-mlj-and-flux/32680 "2021-02-10T23:57:00Z")

</div>

According to the sites: MLJ is an open-source machine learning toolbox written in pure Julia. It provides a uniform interface for interacting with supervised and unsupervised learning models currently scattered in diff…

---

## [Single number and array as input in Flux model](https://discourse.julialang.org/t/single-number-and-array-as-input-in-flux-model/54986)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 1\
**Last updated:** [February 10, 2021, 3:50pm UTC](https://discourse.julialang.org/t/single-number-and-array-as-input-in-flux-model/54986 "2021-02-10T15:50:44Z")

</div>

Suppose I have a Flux simple model like this: model = Dense(1, 10) If I try to call this model with a single number I get an error: model(0.3) # ERROR However If I do this the model works correctly: model(\[0.3\]) D…

---

## [Need help with multivariate multi-step timeseries prediction using RNN](https://discourse.julialang.org/t/need-help-with-multivariate-multi-step-timeseries-prediction-using-rnn/54966)

<div class="topic-metadata">

**Author:** [@UtkarshChemE](https://discourse.julialang.org/u/UtkarshChemE)\
**Replies:** 0\
**Last updated:** [February 10, 2021, 5:29am UTC](https://discourse.julialang.org/t/need-help-with-multivariate-multi-step-timeseries-prediction-using-rnn/54966 "2021-02-10T05:29:40Z")

</div>

My network is as follows: LSTM Encoder (Take a sequence of n lags and output a hidden end vector) Fully Connected Dense Layer (To create a context vector) Decoder network (LSTM layer that process context vector for m l…

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

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