# Machine Learning

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

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

**Page:** 50

---

## [How's AutoGrad different from Flux](https://discourse.julialang.org/t/hows-autograd-different-from-flux/28666)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 0\
**Last updated:** [September 11, 2019, 9:04pm UTC](https://discourse.julialang.org/t/hows-autograd-different-from-flux/28666 "2019-09-11T21:04:02Z")

</div>

Is there any difference between AutoGrad.jl and Flux’s automatic differentiation utilities?

---

## [Federated Learning in Julia](https://discourse.julialang.org/t/federated-learning-in-julia/28535)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 8\
**Last updated:** [September 10, 2019, 11:37am UTC](https://discourse.julialang.org/t/federated-learning-in-julia/28535 "2019-09-10T11:37:36Z")

</div>

Is anyone working with federated learning in Julia? Asking for a friend.

---

## [Transposed convolution aka deconvolution layer in Flux.jl](https://discourse.julialang.org/t/transposed-convolution-aka-deconvolution-layer-in-flux-jl/12142)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 1\
**Last updated:** [September 6, 2019, 8:19pm UTC](https://discourse.julialang.org/t/transposed-convolution-aka-deconvolution-layer-in-flux-jl/12142 "2019-09-06T20:19:30Z")

</div>

I would like to use deconvolutional layer (transposed convolution) in my network. How can this be done in Flux.jl? To be specific, it is described here: image processing - How does the unpooling and deconvolution work …

---

## [Gradient in simple regression not working](https://discourse.julialang.org/t/gradient-in-simple-regression-not-working/27839)

<div class="topic-metadata">

**Author:** [@Ali\_Vahdati](https://discourse.julialang.org/u/Ali_Vahdati)\
**Replies:** 4\
**Last updated:** [September 3, 2019, 10:40am UTC](https://discourse.julialang.org/t/gradient-in-simple-regression-not-working/27839 "2019-09-03T10:40:02Z")

</div>

I tried to replicate a simple regression model from Flux’s documentation with a slightly larger dataset. But the gradient descent seems to always diverge. A manual implementation of the algorithm works well. I would app…

---

## [How to use Flux.train! to train custom layer?](https://discourse.julialang.org/t/how-to-use-flux-train-to-train-custom-layer/28293)

<div class="topic-metadata">

**Author:** [@zhangqian](https://discourse.julialang.org/u/zhangqian)\
**Replies:** 2\
**Last updated:** [September 2, 2019, 6:45pm UTC](https://discourse.julialang.org/t/how-to-use-flux-train-to-train-custom-layer/28293 "2019-09-02T18:45:13Z")

</div>

Hi I am trying to build a toy custom layer according to the instruction from Building Layers (Basics · Flux) in Basics · Flux, and train it with the train! method in Flux.jl. However, the loss does not decrease and the …

---

## [Comparison between time taken in Python and Julia](https://discourse.julialang.org/t/comparison-between-time-taken-in-python-and-julia/28159)

<div class="topic-metadata">

**Author:** [@richie96](https://discourse.julialang.org/u/richie96)\
**Replies:** 2\
**Last updated:** [August 29, 2019, 11:39am UTC](https://discourse.julialang.org/t/comparison-between-time-taken-in-python-and-julia/28159 "2019-08-29T11:39:04Z")

</div>

Hi, I am doing a comparison between Python and Julia by analyzing the same data set. I am using a data set containing nearly 800,000 rows of data. I load the data from two csv files containing equal amount of data each…

---

## [BFloat16 on ARM for neural networks](https://discourse.julialang.org/t/bfloat16-on-arm-for-neural-networks/28200)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [August 30, 2019, 9:56am UTC](https://discourse.julialang.org/t/bfloat16-on-arm-for-neural-networks/28200 "2019-08-30T09:56:19Z")

</div>

How does this play with Julia? Someone will now tell me thereis a BFlaot16 type in core already!

---

## [\[Flux\] Issue while computing Hessian MethodError: objects of type Tracker.Grads are not callable](https://discourse.julialang.org/t/flux-issue-while-computing-hessian-methoderror-objects-of-type-tracker-grads-are-not-callable/27980)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 12\
**Last updated:** [August 28, 2019, 2:52pm UTC](https://discourse.julialang.org/t/flux-issue-while-computing-hessian-methoderror-objects-of-type-tracker-grads-are-not-callable/27980 "2019-08-28T14:52:23Z")

</div>

I’m new to Flux and I’m trying to compute the hessian. Here’s the code: grad = Flux.gradient(() -\> loss(x, y), Flux.params(model)) hess = Flux.gradient(grad, Flux.params(model)) But when running the line to compute he…

---

## [Knet.jl: Simple MLP for Iris Dataset](https://discourse.julialang.org/t/knet-jl-simple-mlp-for-iris-dataset/24839)

<div class="topic-metadata">

**Author:** [@alasaadstat](https://discourse.julialang.org/u/alasaadstat)\
**Replies:** 6\
**Last updated:** [August 28, 2019, 12:26am UTC](https://discourse.julialang.org/t/knet-jl-simple-mlp-for-iris-dataset/24839 "2019-08-28T00:26:11Z")

</div>

Hi everyone, I’m currently studying (I’m not done reading the docs yet) how Knet works. I’m trying to create a classification model for the iris dataset. That is, using the four features of the iris dataset as the predic…

---

## [3D Conv Training Error](https://discourse.julialang.org/t/3d-conv-training-error/26831)

<div class="topic-metadata">

**Author:** [@MaximilianGelbrecht](https://discourse.julialang.org/u/MaximilianGelbrecht)\
**Replies:** 1\
**Last updated:** [August 27, 2019, 1:25pm UTC](https://discourse.julialang.org/t/3d-conv-training-error/26831 "2019-08-27T13:25:45Z")

</div>

Hi there, I encountered an error while setting up a 3D CNN that I dont understand. The problems boils down to this: While in 2D using Flux a, b = rand(5,10,2,10), rand(5,10,2,10) m= Chain(Conv((3,3),2=\>4,pad=(1,1)), …

---

## [How to compute hessian](https://discourse.julialang.org/t/how-to-compute-hessian/28012)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 1\
**Last updated:** [August 26, 2019, 11:14pm UTC](https://discourse.julialang.org/t/how-to-compute-hessian/28012 "2019-08-26T23:14:08Z")

</div>

New to Flux! I want to compute the gradient and hessian for this loss function. loss(x,y) = -sum(y.\*log.(model(x)) .- (1 .- y).\*log.(1 .- model(x))) \* 1 // size(y, 2) where model = Flux.Dense(in,out,σ) And how do yo…

---

## [Error requiring CuArrays from Flux](https://discourse.julialang.org/t/error-requiring-cuarrays-from-flux/27975)

<div class="topic-metadata">

**Author:** [@Lyupinpin](https://discourse.julialang.org/u/Lyupinpin)\
**Replies:** 2\
**Last updated:** [August 26, 2019, 8:45am UTC](https://discourse.julialang.org/t/error-requiring-cuarrays-from-flux/27975 "2019-08-26T08:45:35Z")

</div>

When I use the CuArrays, some warning always confuse me like, using CuArrays ┌ Warning: Error requiring CuArrays from Flux: │ LoadError: LoadError: UndefVarError: libcudnn not defined │ Stacktrace: │ \[1\] include at ./b…

---

## [JuliaML organization and MLJ.jl](https://discourse.julialang.org/t/juliaml-organization-and-mlj-jl/27342)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 5\
**Last updated:** [August 19, 2019, 7:49pm UTC](https://discourse.julialang.org/t/juliaml-organization-and-mlj-jl/27342 "2019-08-19T19:49:43Z")

</div>

I would like to take this opportunity to ask the community about the future of ML in Julia, and how the existing efforts interact. I am particularly interested in understanding to what extent the JuliaML organization and…

---

## [Custom Flux loss function \`culiteral\_pow()\` error](https://discourse.julialang.org/t/custom-flux-loss-function-culiteral-pow-error/27671)

<div class="topic-metadata">

**Author:** [@jchen975](https://discourse.julialang.org/u/jchen975)\
**Replies:** 2\
**Last updated:** [August 18, 2019, 6:16am UTC](https://discourse.julialang.org/t/custom-flux-loss-function-culiteral-pow-error/27671 "2019-08-18T06:16:27Z")

</div>

Hi, I’m trying to build a MLP for a regression problem. A sample of my data looks like this: x= \\left\[ {\\begin{array}{c} \\hat{m\_1}\\\\ \\vdots \\\\ \\hat{m\_k}\\\\ \\hat{n\_1}\\\\ \\vdots \\\\ \\hat{n\_k}\\\\ P \\…

---

## [GPU simulation time of neural ODE program](https://discourse.julialang.org/t/gpu-simulation-time-of-neural-ode-program/27416)

<div class="topic-metadata">

**Author:** [@JunichiFukui](https://discourse.julialang.org/u/JunichiFukui)\
**Replies:** 8\
**Last updated:** [August 16, 2019, 11:43pm UTC](https://discourse.julialang.org/t/gpu-simulation-time-of-neural-ode-program/27416 "2019-08-16T23:43:45Z")

</div>

Hello, I’m trying to run the following neural ODE program using GPU. If I run the code using GPU (NVIDIA GeForce GTX 1050), the simulation time of Flux.train!(loss\_n\_ode, ps, data, opt, cb = cb) part was much longer tha…

---

## [Memory usage seems extremely high in standard Flux, is it any better with Zygote?](https://discourse.julialang.org/t/memory-usage-seems-extremely-high-in-standard-flux-is-it-any-better-with-zygote/27435)

<div class="topic-metadata">

**Author:** [@tue](https://discourse.julialang.org/u/tue)\
**Replies:** 2\
**Last updated:** [August 12, 2019, 7:56am UTC](https://discourse.julialang.org/t/memory-usage-seems-extremely-high-in-standard-flux-is-it-any-better-with-zygote/27435 "2019-08-12T07:56:20Z")

</div>

Hi I’m running some tests on CIFAR10, with a residual CNN, and so far I’m getting very discouraging results for the memory consumption. I’m doing something rather atypical where I regularize each layer of my network sepa…

---

## [Gradient loop vs batch gradient speed](https://discourse.julialang.org/t/gradient-loop-vs-batch-gradient-speed/27209)

<div class="topic-metadata">

**Author:** [@CraftyVisage](https://discourse.julialang.org/u/CraftyVisage)\
**Replies:** 4\
**Last updated:** [August 7, 2019, 12:01am UTC](https://discourse.julialang.org/t/gradient-loop-vs-batch-gradient-speed/27209 "2019-08-07T00:01:36Z")

</div>

I am training a neural network using a manual custom gradient update. I have a loop that goes through every example and computes the gradient of the loss on that example. I then use that gradient in my custom update. Th…

---

## [Instatiate a tracked array? or dynamically store slices of a tracked array? (Not sure what to call this)](https://discourse.julialang.org/t/instatiate-a-tracked-array-or-dynamically-store-slices-of-a-tracked-array-not-sure-what-to-call-this/27101)

<div class="topic-metadata">

**Author:** [@tue](https://discourse.julialang.org/u/tue)\
**Replies:** 6\
**Last updated:** [August 2, 2019, 7:30pm UTC](https://discourse.julialang.org/t/instatiate-a-tracked-array-or-dynamically-store-slices-of-a-tracked-array-not-sure-what-to-call-this/27101 "2019-08-02T19:30:34Z")

</div>

I have some code where I compute what essentially boils down to the following: di = zeros(n,knn) for i=1:n di\[i,:\] = d\[idx\[i\]\] end Now the problem is that d is a tracked array, and hence it cannot be put inside di …

---

## [How to get the number of tracked parameters?](https://discourse.julialang.org/t/how-to-get-the-number-of-tracked-parameters/27096)

<div class="topic-metadata">

**Author:** [@tue](https://discourse.julialang.org/u/tue)\
**Replies:** 4\
**Last updated:** [August 2, 2019, 5:05am UTC](https://discourse.julialang.org/t/how-to-get-the-number-of-tracked-parameters/27096 "2019-08-02T05:05:35Z")

</div>

I’m sure there is a way to get the number of tracked parameters by Flux.Tracker, but so far I still haven’t found any way of actually getting this number. Suppose I make the following: forward = Chain( Conv((5,5), …

---

## [ForwardDiff question](https://discourse.julialang.org/t/forwarddiff-question/26712)

<div class="topic-metadata">

**Author:** [@mbeach42](https://discourse.julialang.org/u/mbeach42)\
**Replies:** 6\
**Last updated:** [July 26, 2019, 4:22am UTC](https://discourse.julialang.org/t/forwarddiff-question/26712 "2019-07-26T04:22:42Z")

</div>

I’m having trouble debugging why ForwardDiff is not working for my function. Below is a mwe. Its very close to working, but I can’t figure it out. using ForwardDiff using LinearAlgebra struct Stack M::Matrix{Int} …

---

## [Parameter tuning in neural ODE](https://discourse.julialang.org/t/parameter-tuning-in-neural-ode/26450)

<div class="topic-metadata">

**Author:** [@JunichiFukui](https://discourse.julialang.org/u/JunichiFukui)\
**Replies:** 15\
**Last updated:** [July 21, 2019, 10:03pm UTC](https://discourse.julialang.org/t/parameter-tuning-in-neural-ode/26450 "2019-07-21T22:03:10Z")

</div>

Hello, I’m trying to reproduce chemical reaction equations using neural ODE system. I calculated time-series of mass fraction of chemical species and temperature using other ODE solver, and exported the solution data to…

---

## [DiffEqFlux with time as additional input to Neural ODE](https://discourse.julialang.org/t/diffeqflux-with-time-as-additional-input-to-neural-ode/26456)

<div class="topic-metadata">

**Author:** [@Michael\_Struwig](https://discourse.julialang.org/u/Michael_Struwig)\
**Replies:** 7\
**Last updated:** [July 21, 2019, 3:41pm UTC](https://discourse.julialang.org/t/diffeqflux-with-time-as-additional-input-to-neural-ode/26456 "2019-07-21T15:41:17Z")

</div>

Hi! My academic or theoretical vocabulary isn’t extensive, so please excuse any lack of terminology on my part. Please point the correct terminology out to me, I’m more than happy to learn. I’ve been enjoying and follo…

---

## [How to correctly handle batches in this model](https://discourse.julialang.org/t/how-to-correctly-handle-batches-in-this-model/26570)

<div class="topic-metadata">

**Author:** [@danipozo](https://discourse.julialang.org/u/danipozo)\
**Replies:** 0\
**Last updated:** [July 20, 2019, 12:03am UTC](https://discourse.julialang.org/t/how-to-correctly-handle-batches-in-this-model/26570 "2019-07-20T00:03:09Z")

</div>

I’m trying to write a model similar to the one in Image to markup with coarse to fine attention, where a fully convolutional network is first applied to an image (resulting in a smaller image with a greater number of cha…

---

## [DiffEqFlux with discrete time-dependent input](https://discourse.julialang.org/t/diffeqflux-with-discrete-time-dependent-input/26397)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 2\
**Last updated:** [July 16, 2019, 4:45pm UTC](https://discourse.julialang.org/t/diffeqflux-with-discrete-time-dependent-input/26397 "2019-07-16T16:45:45Z")

</div>

Hello everyone, I would like to use DiffEqFlux to learn a discrete dynamic equation x(k+1) = A \* x(k) + B, where A(u(k)) and B(u(k)) are time-varying matrix and vector which depend on the input u(k) at the time step k.…

---

## [Type error while using Scikit-learn and PyCall for logistic regression](https://discourse.julialang.org/t/type-error-while-using-scikit-learn-and-pycall-for-logistic-regression/26410)

<div class="topic-metadata">

**Author:** [@richie96](https://discourse.julialang.org/u/richie96)\
**Replies:** 0\
**Last updated:** [July 16, 2019, 10:24am UTC](https://discourse.julialang.org/t/type-error-while-using-scikit-learn-and-pycall-for-logistic-regression/26410 "2019-07-16T10:24:31Z")

</div>

Hi, I have been trying to change a python code into Julia and when trying to fit the Logisic regression model using: @sk\_import linear\_model: LogisticRegression model = fit!(LogisticRegression(multi\_class=“multinomial…

---

## [OnlineStats and regularization hyperparameters](https://discourse.julialang.org/t/onlinestats-and-regularization-hyperparameters/26140)

<div class="topic-metadata">

**Author:** [@GdMacmillan](https://discourse.julialang.org/u/GdMacmillan)\
**Replies:** 5\
**Last updated:** [July 16, 2019, 1:40am UTC](https://discourse.julialang.org/t/onlinestats-and-regularization-hyperparameters/26140 "2019-07-16T01:40:36Z")

</div>

I’m working with online stats to learn a classification model. I have a sparse array of tfidf features and binary target variables and have figured out how to train my model. The API documentation is lacking and needs to…

---

## [Parallel feedforward computation with RNN](https://discourse.julialang.org/t/parallel-feedforward-computation-with-rnn/26378)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 0\
**Last updated:** [July 15, 2019, 8:51am UTC](https://discourse.julialang.org/t/parallel-feedforward-computation-with-rnn/26378 "2019-07-15T08:51:05Z")

</div>

Say you have a sample of 3 observations-label as a training set for a standard fully connected NN. To parallelize the computation of the loss (and the gradient) of each label, you can feed the three observations to the N…

---

## [How can I add to ML model together in Flux](https://discourse.julialang.org/t/how-can-i-add-to-ml-model-together-in-flux/26271)

<div class="topic-metadata">

**Author:** [@Lyupinpin](https://discourse.julialang.org/u/Lyupinpin)\
**Replies:** 2\
**Last updated:** [July 12, 2019, 5:43am UTC](https://discourse.julialang.org/t/how-can-i-add-to-ml-model-together-in-flux/26271 "2019-07-12T05:43:21Z")

</div>

Like I have two model now M1=Chain( Dense(2,10), Dense(10,10,relu), Dense(10,10,relu), Dense(10,10,relu), Dense(10,1) ) M2=Chain( Dense(2,10), Dense(10,10,relu), Dense(10,10,relu), Dense(10,10,relu), Dense(1…

---

## [Flux unable to differentiate an embedding layer](https://discourse.julialang.org/t/flux-unable-to-differentiate-an-embedding-layer/26067)

<div class="topic-metadata">

**Author:** [@merckxiaan](https://discourse.julialang.org/u/merckxiaan)\
**Replies:** 3\
**Last updated:** [July 11, 2019, 10:11am UTC](https://discourse.julialang.org/t/flux-unable-to-differentiate-an-embedding-layer/26067 "2019-07-11T10:11:01Z")

</div>

I’ve made an embedding layer that should be able to embed a batched input. The forward pass seems to work great, I get back an array with the dimensions I expect. The backward pass however, doesn’t work. I get an error …

---

## [Flux: MethodError: no method matching Float32(::Tracker.TrackedReal{Float32})](https://discourse.julialang.org/t/flux-methoderror-no-method-matching-float32-tracker-trackedreal-float32/26018)

<div class="topic-metadata">

**Author:** [@rlrs](https://discourse.julialang.org/u/rlrs)\
**Replies:** 2\
**Last updated:** [July 4, 2019, 6:08pm UTC](https://discourse.julialang.org/t/flux-methoderror-no-method-matching-float32-tracker-trackedreal-float32/26018 "2019-07-04T18:08:11Z")

</div>

I’m trying to calculate gradients through a chain of NN applications where I have some other differentiable operations in between, but Flux fails with the error in the title. I have made a minimal example to show the pro…

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

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