# Machine Learning

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

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

**Page:** 48

---

## [Stop\_gradient/detach equivalent in flux](https://discourse.julialang.org/t/stop-gradient-detach-equivalent-in-flux/31926)

<div class="topic-metadata">

**Author:** [@Rassibassi](https://discourse.julialang.org/u/Rassibassi)\
**Replies:** 2\
**Last updated:** [December 11, 2019, 8:34pm UTC](https://discourse.julialang.org/t/stop-gradient-detach-equivalent-in-flux/31926 "2019-12-11T20:34:14Z")

</div>

Hi, is there an equivalent to Tensorflow’s stop\_gradient/PyTorch’s detach in FluxML? Thanks! Rasmus

---

## [Autoencoder for telecommunication (Constellation shaping)](https://discourse.julialang.org/t/autoencoder-for-telecommunication-constellation-shaping/30613)

<div class="topic-metadata">

**Author:** [@Rassibassi](https://discourse.julialang.org/u/Rassibassi)\
**Replies:** 4\
**Last updated:** [December 11, 2019, 8:32pm UTC](https://discourse.julialang.org/t/autoencoder-for-telecommunication-constellation-shaping/30613 "2019-12-11T20:32:25Z")

</div>

Hi, in telecommunication one can use a autoencoder-ish structure to learn a channel code/constellation shape. I’ve got a working Tensorflow implementation for constellation shaping, but cannot make it work in Julia. I t…

---

## [Custom layer with new parameters in Flux.jl](https://discourse.julialang.org/t/custom-layer-with-new-parameters-in-flux-jl/32143)

<div class="topic-metadata">

**Author:** [@Antomek](https://discourse.julialang.org/u/Antomek)\
**Replies:** 3\
**Last updated:** [December 11, 2019, 5:32pm UTC](https://discourse.julialang.org/t/custom-layer-with-new-parameters-in-flux-jl/32143 "2019-12-11T17:32:14Z")

</div>

Hello everyone, I am new to Flux, but so far I really like it. I was trying to train a neural network where I wanted to include the gain of the sigmoidal activation functions in the cost function, to penalise small gai…

---

## [Flux & Float 64 + model deconstruction?](https://discourse.julialang.org/t/flux-float-64-model-deconstruction/32048)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 10\
**Last updated:** [December 10, 2019, 6:53pm UTC](https://discourse.julialang.org/t/flux-float-64-model-deconstruction/32048 "2019-12-10T18:53:30Z")

</div>

I’m trying to run my past Flux networks, and have a couple of questions. First, I figured out that with model m and data X, I now find predictions by m(X) instead of the old Tracker.data(m(X)) — great, I like that. Nex…

---

## [How to build a bidirectional RNN with Flux?](https://discourse.julialang.org/t/how-to-build-a-bidirectional-rnn-with-flux/32021)

<div class="topic-metadata">

**Author:** [@Rana\_Ian](https://discourse.julialang.org/u/Rana_Ian)\
**Replies:** 1\
**Last updated:** [December 10, 2019, 6:31am UTC](https://discourse.julialang.org/t/how-to-build-a-bidirectional-rnn-with-flux/32021 "2019-12-10T06:31:15Z")

</div>

Hi, How would you build a bidirectional RNN with Flux? Drawing from a few examples Bidirectional LSTM example A Bidirectional LSTM example B Knet bidirectional RNN source I’ve written using Pkg; for p in \["Flux"\] Pk…

---

## [Starting a Deep Learning project, should I keep using Julia or jump to Python?](https://discourse.julialang.org/t/starting-a-deep-learning-project-should-i-keep-using-julia-or-jump-to-python/3840)

<div class="topic-metadata">

**Author:** [@raff](https://discourse.julialang.org/u/raff)\
**Replies:** 15\
**Last updated:** [December 8, 2019, 12:33am UTC](https://discourse.julialang.org/t/starting-a-deep-learning-project-should-i-keep-using-julia-or-jump-to-python/3840 "2019-12-08T00:33:13Z")

</div>

I fully switched from Matlab to Julia to do my machine learning research two years ago. I really like Julia and never look back since then. With Julia, my workflow is more productive than before. But now, I will start a…

---

## [DiffEqFlux and Flux v0.10 (compatibility)](https://discourse.julialang.org/t/diffeqflux-and-flux-v0-10-compatibility/31921)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 7\
**Last updated:** [December 6, 2019, 4:14pm UTC](https://discourse.julialang.org/t/diffeqflux-and-flux-v0-10-compatibility/31921 "2019-12-06T16:14:56Z")

</div>

I’d like to grind through the examples at the C. Rackaukas blog post on NN and ODE (DiffEqFlux.jl – A Julia Library for Neural Differential Equations). However, I’m struggling to get packages working together now. If I…

---

## [Bent identity activation function and Flux.jl?](https://discourse.julialang.org/t/bent-identity-activation-function-and-flux-jl/31807)

<div class="topic-metadata">

**Author:** [@bienpierre](https://discourse.julialang.org/u/bienpierre)\
**Replies:** 2\
**Last updated:** [December 3, 2019, 4:58pm UTC](https://discourse.julialang.org/t/bent-identity-activation-function-and-flux-jl/31807 "2019-12-03T16:58:56Z")

</div>

Dear all, Does flux.jl has the bent identity activation function? I don’t see it in NNlib.jl. Warmest regards

---

## [Why the result from Flux.jl is totally different from tf.Keras (with the same simple MLP)](https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739)

<div class="topic-metadata">

**Author:** [@Carol](https://discourse.julialang.org/u/Carol)\
**Replies:** 6\
**Last updated:** [December 3, 2019, 5:26am UTC](https://discourse.julialang.org/t/why-the-result-from-flux-jl-is-totally-different-from-tf-keras-with-the-same-simple-mlp/31739 "2019-12-03T05:26:04Z")

</div>

Dear all, I want to use Flux.jl to build a simple Multi-Layer Perceptron (MLP) as I did in Keras, where the input data is a matrix of nGene (number of genes) by nInd (number of individuals), output data is a vector of l…

---

## [How to implement MLJ models properly for \`learning\_curve!\`](https://discourse.julialang.org/t/how-to-implement-mlj-models-properly-for-learning-curve/31655)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [December 3, 2019, 4:34am UTC](https://discourse.julialang.org/t/how-to-implement-mlj-models-properly-for-learning-curve/31655 "2019-12-03T04:34:42Z")

</div>

I am trying to copy the XGBoost.jl with Crabs tutorial with JLBoost.jl. I think the data is identical and most things work fine, but I can’t get learning\_curve! to work. Here is the code. using Pkg; Pkg.activate(".") u…

---

## [Is there something better than \`reshape\` for flattening data batches?](https://discourse.julialang.org/t/is-there-something-better-than-reshape-for-flattening-data-batches/31744)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 3\
**Last updated:** [December 2, 2019, 12:16pm UTC](https://discourse.julialang.org/t/is-there-something-better-than-reshape-for-flattening-data-batches/31744 "2019-12-02T12:16:52Z")

</div>

In the MINST example of Flux Model Zoo, the layer that “flattens” tensor data before the Dense layer uses reshape: # Reshape 3d tensor into a 2d one, at this point it should be (3, 3, 32, N) # which is where we get the …

---

## [Has GPU support changed since Flux 0.10?](https://discourse.julialang.org/t/has-gpu-support-changed-since-flux-0-10/31695)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [December 2, 2019, 10:40am UTC](https://discourse.julialang.org/t/has-gpu-support-changed-since-flux-0-10/31695 "2019-12-02T10:40:21Z")

</div>

I get an error message related to CuArrays when I import Flux julia\> using Flux \[ Info: CuArrays.jl failed to initialize and will be unavailable (set JULIA\_CUDA\_SILENT or JULIA\_CUDA\_VERBOSE to silence or expand this mes…

---

## [\[ANN\] MLJ: an update](https://discourse.julialang.org/t/ann-mlj-an-update/31676)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 7\
**Last updated:** [December 1, 2019, 10:55pm UTC](https://discourse.julialang.org/t/ann-mlj-an-update/31676 "2019-12-01T22:55:31Z")

</div>

A lot of work has been done on MLJ and associated repos since @ablaom’s last announcement some 7 months ago so here’s a brief update: MLJ now interfaces with around 100 models including most of ScikitLearn’s, the @pipe…

---

## [CuArrays not working as expected when broadcasting a function](https://discourse.julialang.org/t/cuarrays-not-working-as-expected-when-broadcasting-a-function/31382)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 7\
**Last updated:** [December 1, 2019, 11:02am UTC](https://discourse.julialang.org/t/cuarrays-not-working-as-expected-when-broadcasting-a-function/31382 "2019-12-01T11:02:55Z")

</div>

using CuArrays t = cu(rand(150\_000)) w = cu(rand(150\_000)) t .+ w I define the following function logloss(t, w) = -(t \* log(1 / (1 + exp(-w))) + (1 - t) \* log(1 - 1 / (1 + exp(-w)))) but broadcasting it for CuArrays…

---

## [Whom to follow on GitHub?](https://discourse.julialang.org/t/whom-to-follow-on-github/31623)

<div class="topic-metadata">

**Author:** [@ven-k](https://discourse.julialang.org/u/ven-k)\
**Replies:** 1\
**Last updated:** [November 28, 2019, 1:55pm UTC](https://discourse.julialang.org/t/whom-to-follow-on-github/31623 "2019-11-28T13:55:27Z")

</div>

I want to contribute to open source; specifically in machine learning domain with Julia. I want to know who all to follow on GitHub to get to know the community, new trends etc.

---

## [Need help getting started with FluxML](https://discourse.julialang.org/t/need-help-getting-started-with-fluxml/31196)

<div class="topic-metadata">

**Author:** [@cgo](https://discourse.julialang.org/u/cgo)\
**Replies:** 5\
**Last updated:** [November 25, 2019, 9:47pm UTC](https://discourse.julialang.org/t/need-help-getting-started-with-fluxml/31196 "2019-11-25T21:47:53Z")

</div>

Hi all, I am just getting started with Flux. While the documentation is present, I have a hard time finding some information. In particular, these are some questions that came up: am I to use Zygote or the Tracker m…

---

## [Question Regarding leveraging MLJ.jl's CV features for my own](https://discourse.julialang.org/t/question-regarding-leveraging-mlj-jls-cv-features-for-my-own/31439)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 5\
**Last updated:** [November 25, 2019, 12:42am UTC](https://discourse.julialang.org/t/question-regarding-leveraging-mlj-jls-cv-features-for-my-own/31439 "2019-11-25T00:42:49Z")

</div>

I tried to read through the Adding Models for General Use · MLJ article, but I can’t find any information on how I can expose the hyper-parameters in my model to MLJ.jl so that I can use MLJ’s infrastructure to do CV. Ca…

---

## [Package MNIST not found](https://discourse.julialang.org/t/package-mnist-not-found/31352)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [November 22, 2019, 5:10pm UTC](https://discourse.julialang.org/t/package-mnist-not-found/31352 "2019-11-22T17:10:51Z")

</div>

Attempting to follow the example on https://fluxml.ai/Flux.jl/v0.2/examples/logreg.html for ‘Simple MNIST’ the package ‘MNIST’ cannot be found using Pkg.add \[ I have spent hours just trying to run the first line of th…

---

## [Trying to understand the "gradient()" function from the Flux.jl/Zygote.jl package](https://discourse.julialang.org/t/trying-to-understand-the-gradient-function-from-the-flux-jl-zygote-jl-package/31328)

<div class="topic-metadata">

**Author:** [@rapasite](https://discourse.julialang.org/u/rapasite)\
**Replies:** 4\
**Last updated:** [November 21, 2019, 9:19pm UTC](https://discourse.julialang.org/t/trying-to-understand-the-gradient-function-from-the-flux-jl-zygote-jl-package/31328 "2019-11-21T21:19:45Z")

</div>

Hi there, need some help to dig into https://github.com/FluxML/Zygote.jl/blob/master/src/compiler/interface.jl. So it start like this: function gradient(f, args...) y, back = pullback(f, args...) return back(sensi…

---

## [Gradient of a Hessian dependent loss function](https://discourse.julialang.org/t/gradient-of-a-hessian-dependent-loss-function/31322)

<div class="topic-metadata">

**Author:** [@mtgd](https://discourse.julialang.org/u/mtgd)\
**Replies:** 1\
**Last updated:** [November 21, 2019, 6:35pm UTC](https://discourse.julialang.org/t/gradient-of-a-hessian-dependent-loss-function/31322 "2019-11-21T18:35:38Z")

</div>

For my application it would be useful to have a loss function that depends on the Hessian of a model. Computing the Hessian with respect to the input variable (using Tracker) works fine, but trying to get the gradient w…

---

## [Does ScikitLearn support sample weights for scikit-learn models that do?](https://discourse.julialang.org/t/does-scikitlearn-support-sample-weights-for-scikit-learn-models-that-do/30815)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 1\
**Last updated:** [November 19, 2019, 10:29pm UTC](https://discourse.julialang.org/t/does-scikitlearn-support-sample-weights-for-scikit-learn-models-that-do/30815 "2019-11-19T22:29:42Z")

</div>

In the python scikit-learn the linear model SGDRegressor, and others, support sample weights for training. I could not guess how to access this through the ScikitLearn.jl interface. Is this not supported? using ScikitLe…

---

## [Gradient of parameters that apply only to subsets of data](https://discourse.julialang.org/t/gradient-of-parameters-that-apply-only-to-subsets-of-data/31181)

<div class="topic-metadata">

**Author:** [@mihai](https://discourse.julialang.org/u/mihai)\
**Replies:** 3\
**Last updated:** [November 18, 2019, 8:09pm UTC](https://discourse.julialang.org/t/gradient-of-parameters-that-apply-only-to-subsets-of-data/31181 "2019-11-18T20:09:09Z")

</div>

Hi, I would like to optimize parameters of an analytic function to fit heterogeneous data (different experimental conditions, partly overlapping). I’m using index arrays to know which parameters to use for which data poi…

---

## [How compute \`gradient.(f, w)\` on GPU?](https://discourse.julialang.org/t/how-compute-gradient-f-w-on-gpu/30916)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [November 16, 2019, 8:06am UTC](https://discourse.julialang.org/t/how-compute-gradient-f-w-on-gpu/30916 "2019-11-16T08:06:57Z")

</div>

I can’t seem to figure out how to use the CuArray to compute the gradient of the same function f at many points x. E.g. using Zygote:gradient f(x) = x^2 x = rand(100) gradient.(f, x) the above works fine becuase it’s…

---

## [This custom Zygote.jl adjoint is not giving me the speed up I expected and how to migrate to GPU?](https://discourse.julialang.org/t/this-custom-zygote-jl-adjoint-is-not-giving-me-the-speed-up-i-expected-and-how-to-migrate-to-gpu/31150)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [November 16, 2019, 8:01am UTC](https://discourse.julialang.org/t/this-custom-zygote-jl-adjoint-is-not-giving-me-the-speed-up-i-expected-and-how-to-migrate-to-gpu/31150 "2019-11-16T08:01:50Z")

</div>

I tried to use Zygote.jl to define a custom adjoint for Flux.logitbinarycrossentropy but I don’t get the expected speed up when computing the gradient. The context is that the XGBoost tree boosting algorithm requires tak…

---

## [How to get the gradient of NN wr to its input?](https://discourse.julialang.org/t/how-to-get-the-gradient-of-nn-wr-to-its-input/31034)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 6\
**Last updated:** [November 15, 2019, 5:16pm UTC](https://discourse.julialang.org/t/how-to-get-the-gradient-of-nn-wr-to-its-input/31034 "2019-11-15T17:16:49Z")

</div>

Why do I get this error with this MWE ? nn= Dense(5,1) static\_input = \[1,2,3,4\] variable\_input = 5 opt = Nesterov() ps = Flux.Params(variable\_input) g = Flux.gradient(ps) do sum(nn(vcat(static\_input, variable\_input)…

---

## [Problem of binarycrossentropy with GPU?](https://discourse.julialang.org/t/problem-of-binarycrossentropy-with-gpu/31026)

<div class="topic-metadata">

**Author:** [@taot](https://discourse.julialang.org/u/taot)\
**Replies:** 2\
**Last updated:** [November 15, 2019, 9:49am UTC](https://discourse.julialang.org/t/problem-of-binarycrossentropy-with-gpu/31026 "2019-11-15T09:49:41Z")

</div>

Hi, I am trying to create a model in Flux, with binarycrossentropy in loss function, but encountered a problem invoking binarycrossentropy on GPU. I reproduced the error with this simple case: # just copy from document…

---

## [How to specifying coefficient in NNlib.leakyrelu?](https://discourse.julialang.org/t/how-to-specifying-coefficient-in-nnlib-leakyrelu/31009)

<div class="topic-metadata">

**Author:** [@taot](https://discourse.julialang.org/u/taot)\
**Replies:** 2\
**Last updated:** [November 15, 2019, 9:28am UTC](https://discourse.julialang.org/t/how-to-specifying-coefficient-in-nnlib-leakyrelu/31009 "2019-11-15T09:28:06Z")

</div>

Hi, I am trying to specify the coefficient in leayrelu activation function, something like this: conv1 = Conv( (4,4), 3=\>16, x -\> leakyrelu(x, 0.02), stride=2, pad=(1,1) ) conv2 = Conv( (4,4), 16=\>32, x -\> leakyrelu(x,…

---

## [Seeking advice on learning ML](https://discourse.julialang.org/t/seeking-advice-on-learning-ml/31016)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 8\
**Last updated:** [November 13, 2019, 3:34am UTC](https://discourse.julialang.org/t/seeking-advice-on-learning-ml/31016 "2019-11-13T03:34:35Z")

</div>

I’ve done plenty of dabbling in ML and written some models that work (albeit, not very well) but I’m finding it difficult to 1) navigate the many ML-related topics and decide which ones to spend more time learning and wh…

---

## [Multi-threaded producer - consumer with threads for leading data](https://discourse.julialang.org/t/multi-threaded-producer-consumer-with-threads-for-leading-data/30732)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 16\
**Last updated:** [November 13, 2019, 1:37am UTC](https://discourse.julialang.org/t/multi-threaded-producer-consumer-with-threads-for-leading-data/30732 "2019-11-13T01:37:33Z")

</div>

Dear All, in my training loop of a ML model, I have to iterate over large set of samples which does not fit to the memory. Have anyone tried a producer-consumer model with threads, such that data can be prepared while g…

---

## [Is there an efficient way to compute the Hessian of a NN?](https://discourse.julialang.org/t/is-there-an-efficient-way-to-compute-the-hessian-of-a-nn/26971)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 11\
**Last updated:** [November 12, 2019, 8:25am UTC](https://discourse.julialang.org/t/is-there-an-efficient-way-to-compute-the-hessian-of-a-nn/26971 "2019-11-12T08:25:43Z")

</div>

Flux.jacobian(::Chain, ::AbstractArray) gives the full jacobian of a neural network. Flux.hessian however throws the error “output is not scalar”. Let m = Chain(Dense(5,3,elu), Dense(3,3)) . What I can do is compute the…

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

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