# Machine Learning

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

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

**Page:** 8

---

## [Use Enzyme in flux](https://discourse.julialang.org/t/use-enzyme-in-flux/98352)

<div class="topic-metadata">

**Author:** [@andferrari](https://discourse.julialang.org/u/andferrari)\
**Replies:** 10\
**Last updated:** [June 21, 2024, 9:17pm UTC](https://discourse.julialang.org/t/use-enzyme-in-flux/98352 "2024-06-21T21:17:57Z")

</div>

Hi, I have a complex loss with mutating arrays unsupported by Zygote. Is it possible to use Enzyme.jl with Flux.jl

---

## [How to build Stacked RNN in Flux.jl?](https://discourse.julialang.org/t/how-to-build-stacked-rnn-in-flux-jl/115098)

<div class="topic-metadata">

**Author:** [@NeroBlackstone](https://discourse.julialang.org/u/NeroBlackstone)\
**Replies:** 1\
**Last updated:** [June 18, 2024, 2:25am UTC](https://discourse.julialang.org/t/how-to-build-stacked-rnn-in-flux-jl/115098 "2024-06-18T02:25:17Z")

</div>

How to build Stacked RNN in Flux.jl? Is the following code the correct way? using Flux model = Chain(GRUv3(27 =\> 32),GRUv3(32 =\> 32),Dense(32 =\> 27)) Chain( Recur( GRUv3Cell(27 =\> 32), # 5\_792 par…

---

## [Hybrid ODE with ContinuousCallback for models of changing sizes?](https://discourse.julialang.org/t/hybrid-ode-with-continuouscallback-for-models-of-changing-sizes/115198)

<div class="topic-metadata">

**Author:** [@natalieisenberg](https://discourse.julialang.org/u/natalieisenberg)\
**Replies:** 25\
**Last updated:** [June 17, 2024, 3:39pm UTC](https://discourse.julialang.org/t/hybrid-ode-with-continuouscallback-for-models-of-changing-sizes/115198 "2024-06-17T15:39:24Z")

</div>

I am solving a system of ODEs with a ContinuousCallback where once a condition!() is met, certain members of the state vector are removed (i.e., elements disappear during simulation). I would like to solve this system us…

---

## [Save and load NeuralPDE model for postprocessing](https://discourse.julialang.org/t/save-and-load-neuralpde-model-for-postprocessing/114668)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 3\
**Last updated:** [June 17, 2024, 9:10am UTC](https://discourse.julialang.org/t/save-and-load-neuralpde-model-for-postprocessing/114668 "2024-06-17T09:10:43Z")

</div>

Hi, I want to save a trained NeuralPDE model and then load it to some other script at a later time for analysis and post-processing. In this reply it is suggested to save the trained Lux parameters stored in res.u. I a…

---

## [Optimization.jl and Lux.jl 1.10.0 Compatability](https://discourse.julialang.org/t/optimization-jl-and-lux-jl-1-10-0-compatability/108590)

<div class="topic-metadata">

**Author:** [@afulkers](https://discourse.julialang.org/u/afulkers)\
**Replies:** 3\
**Last updated:** [June 15, 2024, 12:47pm UTC](https://discourse.julialang.org/t/optimization-jl-and-lux-jl-1-10-0-compatability/108590 "2024-06-15T12:47:35Z")

</div>

I was revisiting code I wrote in Julia 1.9.3 which closely mimics the code written by Chris here. While it worked fine in 1.9.3, when I updated my packages and installation to 1.10.0. I started getting the following erro…

---

## [Visualize the points that are used for training in NeuralPDE](https://discourse.julialang.org/t/visualize-the-points-that-are-used-for-training-in-neuralpde/114666)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 1\
**Last updated:** [June 15, 2024, 11:07am UTC](https://discourse.julialang.org/t/visualize-the-points-that-are-used-for-training-in-neuralpde/114666 "2024-06-15T11:07:07Z")

</div>

Hi, I would like to print and visualize the points that are being selected at each iteration by the QuasiRandomTraining strategy in NeuralPDE. I have checked the many fields of symbolic\_discretize but I cannot pinpoint…

---

## [Augmenting positional labels with their corresponding images for training](https://discourse.julialang.org/t/augmenting-positional-labels-with-their-corresponding-images-for-training/115444)

<div class="topic-metadata">

**Author:** [@mward19](https://discourse.julialang.org/u/mward19)\
**Replies:** 0\
**Last updated:** [June 10, 2024, 8:18pm UTC](https://discourse.julialang.org/t/augmenting-positional-labels-with-their-corresponding-images-for-training/115444 "2024-06-10T20:18:39Z")

</div>

I have used Augmentor.jl to perform data augmentation in the past, and it’s a great package. Recently I have been working with image data whose labels are coordinates (i.e., each label is an (x, y) coordinate specifying …

---

## [Reparametrization trick in Flux.jl](https://discourse.julialang.org/t/reparametrization-trick-in-flux-jl/100489)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 8\
**Last updated:** [June 10, 2024, 2:16pm UTC](https://discourse.julialang.org/t/reparametrization-trick-in-flux-jl/100489 "2024-06-10T14:16:38Z")

</div>

Does Flux.jl have an equivalent to rsample in PyTorch that automatically implements these stochastic/policy gradients. That way the reparameterized sample becomes differentiable.

---

## [What's wrong with my training data,RNN network work well on demo but bad on mine](https://discourse.julialang.org/t/whats-wrong-with-my-training-data-rnn-network-work-well-on-demo-but-bad-on-mine/115354)

<div class="topic-metadata">

**Author:** [@Bonjour-Lemonde](https://discourse.julialang.org/u/Bonjour-Lemonde)\
**Replies:** 1\
**Last updated:** [June 8, 2024, 5:23am UTC](https://discourse.julialang.org/t/whats-wrong-with-my-training-data-rnn-network-work-well-on-demo-but-bad-on-mine/115354 "2024-06-08T05:23:51Z")

</div>

Hi all! I had a strange problem using Flux RNN, my training data contains myX:one-hot vector, and myY:a number. The training data shown below worked very well using feedforward network(epoch=20,R2=0.9), but very low usin…

---

## [Best practice to choose epoch or number of features from a recursive feature elimination process?](https://discourse.julialang.org/t/best-practice-to-choose-epoch-or-number-of-features-from-a-recursive-feature-elimination-process/115281)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 0\
**Last updated:** [June 6, 2024, 1:13pm UTC](https://discourse.julialang.org/t/best-practice-to-choose-epoch-or-number-of-features-from-a-recursive-feature-elimination-process/115281 "2024-06-06T13:13:23Z")

</div>

In general, how to find the smallest number which corresponds to best score in a noisy curve? Below is an example result form a recursive feature elimination process. The x axis is the number of features selected and the…

---

## [Flux memory usage high in SRCNN](https://discourse.julialang.org/t/flux-memory-usage-high-in-srcnn/115174)

<div class="topic-metadata">

**Author:** [@AtomsForHire](https://discourse.julialang.org/u/AtomsForHire)\
**Replies:** 3\
**Last updated:** [June 5, 2024, 1:13pm UTC](https://discourse.julialang.org/t/flux-memory-usage-high-in-srcnn/115174 "2024-06-05T13:13:57Z")

</div>

Hello, First let me preface this by saying I am new to Julia and machine learning. I just wanted to dip my toes into machine learning for fun, started out with OCR using an MLP first and now I’m trying to implement a su…

---

## [How to build a bi-LSTM in Flux.jl 0.14](https://discourse.julialang.org/t/how-to-build-a-bi-lstm-in-flux-jl-0-14/115114)

<div class="topic-metadata">

**Author:** [@NeroBlackstone](https://discourse.julialang.org/u/NeroBlackstone)\
**Replies:** 0\
**Last updated:** [June 3, 2024, 11:28am UTC](https://discourse.julialang.org/t/how-to-build-a-bi-lstm-in-flux-jl-0-14/115114 "2024-06-03T11:28:03Z")

</div>

There is currently a wrapper layer waiting to be merged, but it has not been updated in several years. There is also an early speech recognition example in the Model Zoo, but it only supports Flux 0.6 and Flux 0.10. So…

---

## [Using the gradient of wrt the input in the loss function](https://discourse.julialang.org/t/using-the-gradient-of-wrt-the-input-in-the-loss-function/114983)

<div class="topic-metadata">

**Author:** [@alekssek](https://discourse.julialang.org/u/alekssek)\
**Replies:** 6\
**Last updated:** [June 2, 2024, 10:33am UTC](https://discourse.julialang.org/t/using-the-gradient-of-wrt-the-input-in-the-loss-function/114983 "2024-06-02T10:33:07Z")

</div>

I have attempted this for a few days but I can not figure out how to do this. Basically I am attempting to adapt a hamiltonian neural network (hnn), which requires the following loss function: Loss = || dH/dq - dq/dt||\_2…

---

## [Problem of memory usage with MLJ+LightGBM and grid search](https://discourse.julialang.org/t/problem-of-memory-usage-with-mlj-lightgbm-and-grid-search/112147)

<div class="topic-metadata">

**Author:** [@julien\_goo](https://discourse.julialang.org/u/julien_goo)\
**Replies:** 10\
**Last updated:** [June 1, 2024, 4:51am UTC](https://discourse.julialang.org/t/problem-of-memory-usage-with-mlj-lightgbm-and-grid-search/112147 "2024-06-01T04:51:43Z")

</div>

Hi all, We are building an application of ML using MLJ and LightGBM (for the ML part) to perform some forecasts on complex time series (for a quite critical business need, in production with daily use) We have a blocki…

---

## [Neural ODEs and ODE parameter estimation](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950)

<div class="topic-metadata">

**Author:** [@usiam](https://discourse.julialang.org/u/usiam)\
**Replies:** 3\
**Last updated:** [May 30, 2024, 3:35pm UTC](https://discourse.julialang.org/t/neural-odes-and-ode-parameter-estimation/114950 "2024-05-30T15:35:10Z")

</div>

I’m trying to do some parameter estimation of parameters in a set of coupled (stiff) differential equations by using some limited data and found out about Julia’s ODE suite. Looking through some of the examples, such as…

---

## [How to train MLJ model on DataFrame, but apply on Vector of Arrays?](https://discourse.julialang.org/t/how-to-train-mlj-model-on-dataframe-but-apply-on-vector-of-arrays/114669)

<div class="topic-metadata">

**Author:** [@niltsz](https://discourse.julialang.org/u/niltsz)\
**Replies:** 2\
**Last updated:** [May 25, 2024, 5:44pm UTC](https://discourse.julialang.org/t/how-to-train-mlj-model-on-dataframe-but-apply-on-vector-of-arrays/114669 "2024-05-25T17:44:36Z")

</div>

I train my MLJ Model (EvoTrees.jl) on a Julia DataFrame with the scalars x1, x2, and x3 as features and y as label. However, when doing the inference, I have higher dimensional arrays instead of tabular data. Any suggest…

---

## [Multi Input Multi Output CNN with Flux](https://discourse.julialang.org/t/multi-input-multi-output-cnn-with-flux/114624)

<div class="topic-metadata">

**Author:** [@cojiro182](https://discourse.julialang.org/u/cojiro182)\
**Replies:** 0\
**Last updated:** [May 23, 2024, 12:08pm UTC](https://discourse.julialang.org/t/multi-input-multi-output-cnn-with-flux/114624 "2024-05-23T12:08:45Z")

</div>

Hi, I am super new to machine learning and the Flux.jl package and I am having trouble setting up my model. I am effectively trying to train a dataset of 3 images to predict an output of 2 different images. The inputs a…

---

## [Bug at solve method for Universall Differential Equations?](https://discourse.julialang.org/t/bug-at-solve-method-for-universall-differential-equations/114566)

<div class="topic-metadata">

**Author:** [@Alergy](https://discourse.julialang.org/u/Alergy)\
**Replies:** 1\
**Last updated:** [May 22, 2024, 2:07pm UTC](https://discourse.julialang.org/t/bug-at-solve-method-for-universall-differential-equations/114566 "2024-05-22T14:07:41Z")

</div>

I am trying to somewhat emulate the Universal Differential Equations tutorial, with a little twist. What I want to do is to learn the parameters of both a Differential Equation AND a Neural Network. Here is the only cod…

---

## [Support of Rockchip RK3588S NPU](https://discourse.julialang.org/t/support-of-rockchip-rk3588s-npu/89868)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 11\
**Last updated:** [May 21, 2024, 10:32am UTC](https://discourse.julialang.org/t/support-of-rockchip-rk3588s-npu/89868 "2024-05-21T10:32:20Z")

</div>

A new ARM CPU is available, that is at least three times a powerful as a Raspberry Pi 4. It also has a neural network processing unit, which is supported by Python. Will it also be supported by Julia? What would be neede…

---

## [LWPR in Julia](https://discourse.julialang.org/t/lwpr-in-julia/7578)

<div class="topic-metadata">

**Author:** [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Replies:** 2\
**Last updated:** [May 16, 2024, 7:24pm UTC](https://discourse.julialang.org/t/lwpr-in-julia/7578 "2024-05-16T19:24:36Z")

</div>

I’m considering playing around with Locally Weighted Projection Regression (LWPR), and I was curious if anyone was aware of any Julia implementations of the algorithm (Google, alas, is not). I’m aware of SLMC | InfWeb (…

---

## [Training Flux LSTM on GPU is slower than on CPU](https://discourse.julialang.org/t/training-flux-lstm-on-gpu-is-slower-than-on-cpu/114250)

<div class="topic-metadata">

**Author:** [@dtramtn](https://discourse.julialang.org/u/dtramtn)\
**Replies:** 1\
**Last updated:** [May 16, 2024, 11:51am UTC](https://discourse.julialang.org/t/training-flux-lstm-on-gpu-is-slower-than-on-cpu/114250 "2024-05-16T11:51:26Z")

</div>

Hi, I’m trying to train an LSTM with timeseries data using Flux and attempting to speed it up by training on the GPU, but it takes longer than on the CPU. The data is an n\_features x n\_observation matrix as generated i…

---

## [Guidance on POS Tagging and lemmatization approach](https://discourse.julialang.org/t/guidance-on-pos-tagging-and-lemmatization-approach/114344)

<div class="topic-metadata">

**Author:** [@Amval](https://discourse.julialang.org/u/Amval)\
**Replies:** 0\
**Last updated:** [May 16, 2024, 7:33am UTC](https://discourse.julialang.org/t/guidance-on-pos-tagging-and-lemmatization-approach/114344 "2024-05-16T07:33:54Z")

</div>

Hello, I’d like to do some basic NLP tasks (POS Tagging, lemmatization) in languages other than English. . Or, more specifically, German. Currently, I am using SpaCy through PyCall with the german model. This is fine, h…

---

## [ParameterSchedulers causing error with Flux.update!](https://discourse.julialang.org/t/parameterschedulers-causing-error-with-flux-update/114287)

<div class="topic-metadata">

**Author:** [@cjs](https://discourse.julialang.org/u/cjs)\
**Replies:** 0\
**Last updated:** [May 15, 2024, 7:56am UTC](https://discourse.julialang.org/t/parameterschedulers-causing-error-with-flux-update/114287 "2024-05-15T07:56:32Z")

</div>

I am running a DRL algorithm with Adam where I want the learning rate to decay with time. As an example, consider using Flux, ParameterSchedulers model = Chain(Dense(5,10,gelu), Dense(10,10,gelu), Dense(10,1,softplus)) …

---

## [Zygote much slower than JAX for automatic differentiation of energy](https://discourse.julialang.org/t/zygote-much-slower-than-jax-for-automatic-differentiation-of-energy/114239)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 22\
**Last updated:** [May 15, 2024, 6:31am UTC](https://discourse.julialang.org/t/zygote-much-slower-than-jax-for-automatic-differentiation-of-energy/114239 "2024-05-15T06:31:51Z")

</div>

Hello, I’m new in the neural network field, and I’m starting to study Neural Network Quantum States (for example ground state searching using neural networks). Usually, they are implemented in Python using Jax, but then…

---

## [How to code RealNVP using invertibleNetworks.jl?](https://discourse.julialang.org/t/how-to-code-realnvp-using-invertiblenetworks-jl/114267)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 0\
**Last updated:** [May 14, 2024, 6:32pm UTC](https://discourse.julialang.org/t/how-to-code-realnvp-using-invertiblenetworks-jl/114267 "2024-05-14T18:32:21Z")

</div>

I am using invertibleNetworks.jl as a library for normalizing flows. However, the examples included are for the GLOW architecture and others, but I would like to use the RealNVP architecture, and I have not been able to …

---

## [Issue understanding Lux recurrent cells](https://discourse.julialang.org/t/issue-understanding-lux-recurrent-cells/114249)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 1\
**Last updated:** [May 14, 2024, 4:03pm UTC](https://discourse.julialang.org/t/issue-understanding-lux-recurrent-cells/114249 "2024-05-14T16:03:43Z")

</div>

I am trying to turn the following code to Lux.jl def generator(gru\_units, dense\_units, sequence\_length, noise\_dimension, model\_dimension): # Inputs. inputs = tf.keras.layers.Input(shape=(sequence\_length, mod…

---

## [NeuralPDE fails to solve system when parameters change](https://discourse.julialang.org/t/neuralpde-fails-to-solve-system-when-parameters-change/114169)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [May 12, 2024, 6:49pm UTC](https://discourse.julialang.org/t/neuralpde-fails-to-solve-system-when-parameters-change/114169 "2024-05-12T18:49:25Z")

</div>

I am hitting a weird situation that I can not figure out why – perhaps it’s a bug within NeuralPDE or maybe just need to tweak my settings. Given the Lorenzs system in this example (i.e., eqs) I am able to do forward si…

---

## [Is there an equivalent of LazyLinear in Flux.jl?](https://discourse.julialang.org/t/is-there-an-equivalent-of-lazylinear-in-flux-jl/114165)

<div class="topic-metadata">

**Author:** [@NeroBlackstone](https://discourse.julialang.org/u/NeroBlackstone)\
**Replies:** 0\
**Last updated:** [May 12, 2024, 10:46am UTC](https://discourse.julialang.org/t/is-there-an-equivalent-of-lazylinear-in-flux-jl/114165 "2024-05-12T10:46:57Z")

</div>

LazyLinear It seems that a similar option in Flux.jl is @autosize. But we still need to manually pass in the first input layer dimension.

---

## [Why do we need 3 chains to solve a PDE using NeuralPDE](https://discourse.julialang.org/t/why-do-we-need-3-chains-to-solve-a-pde-using-neuralpde/108136)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 7\
**Last updated:** [May 11, 2024, 9:04pm UTC](https://discourse.julialang.org/t/why-do-we-need-3-chains-to-solve-a-pde-using-neuralpde/108136 "2024-05-11T21:04:21Z")

</div>

I am working through examples from NeuralPDE.jl package and have a question. I am looking at the inverse problem example (i.e. parameter estimation) and just need to get my thinking straight. This is more of a conceptual…

---

## [Flux CNN error: Scalar indexing is disallowed](https://discourse.julialang.org/t/flux-cnn-error-scalar-indexing-is-disallowed/88973)

<div class="topic-metadata">

**Author:** [@amitjamadagni](https://discourse.julialang.org/u/amitjamadagni)\
**Replies:** 4\
**Last updated:** [May 11, 2024, 5:39am UTC](https://discourse.julialang.org/t/flux-cnn-error-scalar-indexing-is-disallowed/88973 "2024-05-11T05:39:49Z")

</div>

Hi! I have 1D data which I can successfully train and test with all to all connected 3 layer model as below: function build\_model\_ffn(; nclasses=2) return Chain( Dense(99, 48, relu), Dense(4…

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

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