# Machine Learning

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

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

**Page:** 20

---

## [How to load BSON file of the model build with Flux@0.12.10 to use with Flux@0.13? Flux.Diagonal deprecated problem](https://discourse.julialang.org/t/how-to-load-bson-file-of-the-model-build-with-flux-0-12-10-to-use-with-flux-0-13-flux-diagonal-deprecated-problem/91588)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 7\
**Last updated:** [December 27, 2022, 4:24pm UTC](https://discourse.julialang.org/t/how-to-load-bson-file-of-the-model-build-with-flux-0-12-10-to-use-with-flux-0-13-flux-diagonal-deprecated-problem/91588 "2022-12-27T16:24:02Z")

</div>

I have a Transformer model that was built using Transformers.jl and Flux@0.12.10. After training the model, I saved it using BSON. Since Flux@0.13, Flux.Diagonal is deprecated and when I try to load model using BSON an…

---

## [Flux on Production enviroment](https://discourse.julialang.org/t/flux-on-production-enviroment/92136)

<div class="topic-metadata">

**Author:** [@shivance](https://discourse.julialang.org/u/shivance)\
**Replies:** 2\
**Last updated:** [December 26, 2022, 12:17pm UTC](https://discourse.julialang.org/t/flux-on-production-enviroment/92136 "2022-12-26T12:17:21Z")

</div>

We came across this thread (which dates back to two years), which pretty much demonstrates the state of Flux in production environment, which remains intact. Julia is indeed provides a tech stack, which a company once ch…

---

## [Training a neural network within method of lines and ODE solve framework](https://discourse.julialang.org/t/training-a-neural-network-within-method-of-lines-and-ode-solve-framework/86293)

<div class="topic-metadata">

**Author:** [@kaido975](https://discourse.julialang.org/u/kaido975)\
**Replies:** 3\
**Last updated:** [December 24, 2022, 6:15pm UTC](https://discourse.julialang.org/t/training-a-neural-network-within-method-of-lines-and-ode-solve-framework/86293 "2022-12-24T18:15:02Z")

</div>

I am trying to train a neural network which is a part of a PDE, I am solving the PDE with MOL and ODE solve. Below is the forward pass i.e getting the solution with ODE solve which runs fine. import ModelingToolkit: Int…

---

## [How to @opt\_out rules defined with RuleConfig in Zygote](https://discourse.julialang.org/t/how-to-opt-out-rules-defined-with-ruleconfig-in-zygote/92014)

<div class="topic-metadata">

**Author:** [@tansongchen](https://discourse.julialang.org/u/tansongchen)\
**Replies:** 0\
**Last updated:** [December 22, 2022, 6:29pm UTC](https://discourse.julialang.org/t/how-to-opt-out-rules-defined-with-ruleconfig-in-zygote/92014 "2022-12-22T18:29:16Z")

</div>

Let’s say I have a type WeirdNumber \<: Number is so weird that I don’t want its derivative of power function (^) be calculated by rrule of ^ and literal\_pow, and should instead go through and differentiate its definition…

---

## [Mini batching with ensemble problem diffeq and neural ode's sciml](https://discourse.julialang.org/t/mini-batching-with-ensemble-problem-diffeq-and-neural-odes-sciml/91665)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 11\
**Last updated:** [December 20, 2022, 11:26pm UTC](https://discourse.julialang.org/t/mini-batching-with-ensemble-problem-diffeq-and-neural-odes-sciml/91665 "2022-12-20T23:26:19Z")

</div>

Following this excellent example: https://docs.sciml.ai/SciMLSensitivity/stable/ode\_fitting/data\_parallel/#Minibatching-Across-GPUs-with-DiffEqGPU The title seems to tempt me with the syntax for micro-batching to make …

---

## [Comparison between Julia and Python Random Forest Regression](https://discourse.julialang.org/t/comparison-between-julia-and-python-random-forest-regression/28033)

<div class="topic-metadata">

**Author:** [@richie96](https://discourse.julialang.org/u/richie96)\
**Replies:** 6\
**Last updated:** [December 20, 2022, 12:55pm UTC](https://discourse.julialang.org/t/comparison-between-julia-and-python-random-forest-regression/28033 "2022-12-20T12:55:34Z")

</div>

Hi, I am doing a comparison between Julia and Python by converting a python ML code into Julia and the documenting the time taken by both the codes for different sections. I am using Random Forest algorithm. In Julia, I…

---

## [Training Neural SDEs with Mutating Arrays](https://discourse.julialang.org/t/training-neural-sdes-with-mutating-arrays/91877)

<div class="topic-metadata">

**Author:** [@ChrisVL1](https://discourse.julialang.org/u/ChrisVL1)\
**Replies:** 2\
**Last updated:** [December 20, 2022, 7:46am UTC](https://discourse.julialang.org/t/training-neural-sdes-with-mutating-arrays/91877 "2022-12-20T07:46:51Z")

</div>

I am writing a training function that requires a loop as my loss is the difference between call prices which I need to calculate for various strikes using a loop. However, this results in a mutating array, how do I get a…

---

## [Example of the use DecisionTree.permutation\_importance function based on MLJ](https://discourse.julialang.org/t/example-of-the-use-decisiontree-permutation-importance-function-based-on-mlj/91521)

<div class="topic-metadata">

**Author:** [@lgmendes](https://discourse.julialang.org/u/lgmendes)\
**Replies:** 2\
**Last updated:** [December 13, 2022, 1:57am UTC](https://discourse.julialang.org/t/example-of-the-use-decisiontree-permutation-importance-function-based-on-mlj/91521 "2022-12-13T01:57:23Z")

</div>

Can someone give me a small example of how to use the function DecisionTree.permutation\_importance() using an MLJ Tree machine (Tree = @load DecisionTreeClassifier pkg=DecisionTree)? A Python similar function is sklear…

---

## [Flux, categorical arrays, roc curves, confusion matrices](https://discourse.julialang.org/t/flux-categorical-arrays-roc-curves-confusion-matrices/91282)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 14\
**Last updated:** [December 12, 2022, 8:32pm UTC](https://discourse.julialang.org/t/flux-categorical-arrays-roc-curves-confusion-matrices/91282 "2022-12-12T20:32:29Z")

</div>

Dear all, I’m trying Flux to build a prediction for the occurrence of an event given a data set containing both continuous (Float64) and categorical arrays (Int64). I’m learning from the tutorials and the talk Julia vid…

---

## [PyTorch 2.0](https://discourse.julialang.org/t/pytorch-2-0/91169)

<div class="topic-metadata">

**Author:** [@davide445](https://discourse.julialang.org/u/davide445)\
**Replies:** 0\
**Last updated:** [December 3, 2022, 7:36am UTC](https://discourse.julialang.org/t/pytorch-2-0/91169 "2022-12-03T07:36:55Z")

</div>

I get notified about the new release Not an expert just talking with specialists and finding my way getting to know Flux a bit for my simulation experiments, wanted to know the opinion of other forumeers if this PyT r…

---

## [Null gradients with GANs](https://discourse.julialang.org/t/null-gradients-with-gans/91099)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.julialang.org/u/LucasMSpereira)\
**Replies:** 1\
**Last updated:** [December 2, 2022, 12:41am UTC](https://discourse.julialang.org/t/null-gradients-with-gans/91099 "2022-12-02T00:41:10Z")

</div>

When trying to replicate a paper that uses GANs with unconventional loss calculations, I’m having problems with null gradients. The basic steps are the following: genOutput = gen(genInput) MSE(genOut, label) MAE(genOut…

---

## [AlphaZero MCTS formula question](https://discourse.julialang.org/t/alphazero-mcts-formula-question/70673)

<div class="topic-metadata">

**Author:** [@aaowens](https://discourse.julialang.org/u/aaowens)\
**Replies:** 1\
**Last updated:** [November 27, 2022, 10:12pm UTC](https://discourse.julialang.org/t/alphazero-mcts-formula-question/70673 "2022-11-27T22:12:54Z")

</div>

I’m trying to understand the MCTS used in AlphaZero, and I’m a bit confused by the upper confidence bound formula, which I’ve seen in most places as Q(s,a) + c \* P(s,a) \* \\frac{\\sqrt{\\sum\_b{ N(s,b)}}}{1 + N(s,a)} and a…

---

## [Simplechains.jl vs. George Hotz & Tinygrad?](https://discourse.julialang.org/t/simplechains-jl-vs-george-hotz-tinygrad/90387)

<div class="topic-metadata">

**Author:** [@artkuo](https://discourse.julialang.org/u/artkuo)\
**Replies:** 2\
**Last updated:** [November 27, 2022, 7:18pm UTC](https://discourse.julialang.org/t/simplechains-jl-vs-george-hotz-tinygrad/90387 "2022-11-27T19:18:11Z")

</div>

George Hotz recently stepped down from comma.ai and announced he may devote more effort to his Tinygrad package: I’m considering another company, the Tiny Corporation. Under 1000 lines, under 3 people, 3x faster than P…

---

## [How to get the results and gradients when using ForwardDiff.jl](https://discourse.julialang.org/t/how-to-get-the-results-and-gradients-when-using-forwarddiff-jl/90525)

<div class="topic-metadata">

**Author:** [@Frankiewaang](https://discourse.julialang.org/u/Frankiewaang)\
**Replies:** 9\
**Last updated:** [November 25, 2022, 4:21pm UTC](https://discourse.julialang.org/t/how-to-get-the-results-and-gradients-when-using-forwarddiff-jl/90525 "2022-11-25T16:21:24Z")

</div>

I did some research and found out that if I want to get both the value of a function and its gradients I could use the API from DiffResults. But if the result from a function returns a tuple(instead of a scalar) where th…

---

## [DimensionMismatch: The size of a distance matrix ((1, 440)) doesn't match the length of assignment vector (440)](https://discourse.julialang.org/t/dimensionmismatch-the-size-of-a-distance-matrix-1-440-doesnt-match-the-length-of-assignment-vector-440/90807)

<div class="topic-metadata">

**Author:** [@JUL1A](https://discourse.julialang.org/u/JUL1A)\
**Replies:** 3\
**Last updated:** [November 25, 2022, 3:36pm UTC](https://discourse.julialang.org/t/dimensionmismatch-the-size-of-a-distance-matrix-1-440-doesnt-match-the-length-of-assignment-vector-440/90807 "2022-11-25T15:36:13Z")

</div>

How to fix this: using Clustering using VectorizedStatistics function MyKmeans(Train::Vector{Float64}, k::Int64) the\_mat = Train' model = kmeans(the\_mat, k) return vmean(silhouettes(assignments(model), cou…

---

## [Flux RNN training giving \`BoundsError\`](https://discourse.julialang.org/t/flux-rnn-training-giving-boundserror/90723)

<div class="topic-metadata">

**Author:** [@mjyshin](https://discourse.julialang.org/u/mjyshin)\
**Replies:** 3\
**Last updated:** [November 25, 2022, 3:12am UTC](https://discourse.julialang.org/t/flux-rnn-training-giving-boundserror/90723 "2022-11-25T03:12:01Z")

</div>

I was originally trying to train a network with recurrence using GRUs but I kept getting this BoundsError: attempt to access Tuple{} at index \[0\]. So I gave up and tried running the rnn-char example in the model-zoo, wit…

---

## [Input to Neural Network](https://discourse.julialang.org/t/input-to-neural-network/90770)

<div class="topic-metadata">

**Author:** [@Kuldeep](https://discourse.julialang.org/u/Kuldeep)\
**Replies:** 1\
**Last updated:** [November 24, 2022, 9:11pm UTC](https://discourse.julialang.org/t/input-to-neural-network/90770 "2022-11-24T21:11:21Z")

</div>

Hi, I am new to both Julia and deep learning. Suppose we define a following network: using Flux nn\_width = 10 m = Chain(Dense(1,nn\_width,tanh), Dense(nn\_width,nn\_width,tanh), Dense(nn\_width,1…

---

## [Multiple linear regression model using Flux.jl](https://discourse.julialang.org/t/multiple-linear-regression-model-using-flux-jl/90775)

<div class="topic-metadata">

**Author:** [@moataz-sabry](https://discourse.julialang.org/u/moataz-sabry)\
**Replies:** 1\
**Last updated:** [November 24, 2022, 8:57pm UTC](https://discourse.julialang.org/t/multiple-linear-regression-model-using-flux-jl/90775 "2022-11-24T20:57:23Z")

</div>

Hello everyone, I’m new to machine learning and I was trying to extend the basic example from Flux documentation to a multiple linear regression model where the input S and the output V are both vectors with 3 elements …

---

## [Loss functions that involve gradients](https://discourse.julialang.org/t/loss-functions-that-involve-gradients/55293)

<div class="topic-metadata">

**Author:** [@balaji1975](https://discourse.julialang.org/u/balaji1975)\
**Replies:** 4\
**Last updated:** [November 22, 2022, 2:08am UTC](https://discourse.julialang.org/t/loss-functions-that-involve-gradients/55293 "2022-11-22T02:08:03Z")

</div>

This is similar to this question. I am training a neural net NN(), where the loss function involves gradient of NN(.) wrt to the input. For example: m = Flux.Chain(Dense(5,5,relu), Dense(5,5,relu), Dense(5,1)) g(z) = o…

---

## [MLJ Tuning, MLJ](https://discourse.julialang.org/t/mlj-tuning-mlj/90544)

<div class="topic-metadata">

**Author:** [@Mr.Benz](https://discourse.julialang.org/u/Mr.Benz)\
**Replies:** 0\
**Last updated:** [November 20, 2022, 4:06pm UTC](https://discourse.julialang.org/t/mlj-tuning-mlj/90544 "2022-11-20T16:06:14Z")

</div>

I started with julia , new to data science. i have a quetion on MLJ tuning ang iteratied model. in a loop , Do we need to do TunedModel + IteratedModel +evaluate or IteratedModel +TunedModel +evaluate which is best…

---

## [Can I reconstruct a network using Flux.params in Flux.jl?](https://discourse.julialang.org/t/can-i-reconstruct-a-network-using-flux-params-in-flux-jl/90531)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 2\
**Last updated:** [November 20, 2022, 9:31am UTC](https://discourse.julialang.org/t/can-i-reconstruct-a-network-using-flux-params-in-flux-jl/90531 "2022-11-20T09:31:04Z")

</div>

Hi, I have a custom network nn. I can get the parameters p of nn by p = Flux.params(nn). Now, I’d like to reconstruct a neural network from the parameters. Is there any some ways to do the following? nn = NN() # con…

---

## [Why is Flux's data input format different?](https://discourse.julialang.org/t/why-is-fluxs-data-input-format-different/90490)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 1\
**Last updated:** [November 19, 2022, 11:31am UTC](https://discourse.julialang.org/t/why-is-fluxs-data-input-format-different/90490 "2022-11-19T11:31:02Z")

</div>

Hi, In Flux models (created using Chain), we give data array of the format D x N (D - data dimension, N - number of samples). This is is different from other ML libraries such as Tensorflow/PyTorch where we use N x D fo…

---

## [How to coerce scitype union to continuous?](https://discourse.julialang.org/t/how-to-coerce-scitype-union-to-continuous/90379)

<div class="topic-metadata">

**Author:** [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Replies:** 1\
**Last updated:** [November 17, 2022, 8:51pm UTC](https://discourse.julialang.org/t/how-to-coerce-scitype-union-to-continuous/90379 "2022-11-17T20:51:38Z")

</div>

All columns in my DataFrame have the sci type Union{Continuous, Count} and I’m having trouble coercing them to Continuous. I tried the following two ways coerce(X, Count=\>Continuous) X |\> eachcol .|\> a -\> coerce(a, Con…

---

## [Batching in Geometric Flux](https://discourse.julialang.org/t/batching-in-geometric-flux/90120)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 6\
**Last updated:** [November 17, 2022, 11:03am UTC](https://discourse.julialang.org/t/batching-in-geometric-flux/90120 "2022-11-17T11:03:57Z")

</div>

Hi, can anyone shed me a light on how minibatching in GeometricFlux works? Particularly I am interested in running minibatch on a set of graphs with different edge matrices. Thanks for an answer, Tomas

---

## [Unexpected Behavior in LogisticClassifier MLJLinearModels](https://discourse.julialang.org/t/unexpected-behavior-in-logisticclassifier-mljlinearmodels/90013)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 7\
**Last updated:** [November 16, 2022, 8:37pm UTC](https://discourse.julialang.org/t/unexpected-behavior-in-logisticclassifier-mljlinearmodels/90013 "2022-11-16T20:37:52Z")

</div>

I am experiencing some odd behavior from the Logistic Classifier in MLJLinearModels.jl that maybe somebody can help me to understand. This MWE is not the research problem I am working on (because that is hard to boil dow…

---

## [Lux.jl implementation of denoising diffusion model](https://discourse.julialang.org/t/lux-jl-implementation-of-denoising-diffusion-model/90275)

<div class="topic-metadata">

**Author:** [@Keisuke\_Yanagi](https://discourse.julialang.org/u/Keisuke_Yanagi)\
**Replies:** 2\
**Last updated:** [November 15, 2022, 11:05pm UTC](https://discourse.julialang.org/t/lux-jl-implementation-of-denoising-diffusion-model/90275 "2022-11-15T23:05:30Z")

</div>

Hi Using Lux.jl, I’ve implemented denoising diffusion implicit model for image generation from noises. Question: is there any place for me to contribute to enhance the Lux.jl examples? (Just making PR on the repo?)

---

## [Initialize Lux.jl NN parameters according to Lux.glorot\_normal](https://discourse.julialang.org/t/initialize-lux-jl-nn-parameters-according-to-lux-glorot-normal/90293)

<div class="topic-metadata">

**Author:** [@MilesCB](https://discourse.julialang.org/u/MilesCB)\
**Replies:** 1\
**Last updated:** [November 15, 2022, 8:10pm UTC](https://discourse.julialang.org/t/initialize-lux-jl-nn-parameters-according-to-lux-glorot-normal/90293 "2022-11-15T20:10:26Z")

</div>

Hi all, I would like to initialize the parameters of a Lux.jl neural network with something other than a random distribution; for instance with Lux.glorot\_normal. I am using this network with NeuralPDE.jl with the follo…

---

## [How to rewrite a jax model with stacked parameters](https://discourse.julialang.org/t/how-to-rewrite-a-jax-model-with-stacked-parameters/90150)

<div class="topic-metadata">

**Author:** [@Frankiewaang](https://discourse.julialang.org/u/Frankiewaang)\
**Replies:** 6\
**Last updated:** [November 12, 2022, 8:15pm UTC](https://discourse.julialang.org/t/how-to-rewrite-a-jax-model-with-stacked-parameters/90150 "2022-11-12T20:15:48Z")

</div>

Hi, I have been using Julia for a while but new to the Julia ML ecosystem. I want to rewrite a lease square monte carlo model with neural nets using Lux or Flux. Here is the main code from python’s jax, basically it wou…

---

## [Flux.jl: Using CuDNN for RNNs](https://discourse.julialang.org/t/flux-jl-using-cudnn-for-rnns/89988)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 2\
**Last updated:** [November 11, 2022, 1:19pm UTC](https://discourse.julialang.org/t/flux-jl-using-cudnn-for-rnns/89988 "2022-11-11T13:19:41Z")

</div>

I have seen that Flux.jl does not use CuDNN for RNNs. Does this have a specific reason? Going through the issues is really confusing, it seems that support for this was removed because tests would fail. There are also o…

---

## [Flux.jl: Save model and optimizer from gpu](https://discourse.julialang.org/t/flux-jl-save-model-and-optimizer-from-gpu/89982)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 1\
**Last updated:** [November 9, 2022, 9:06pm UTC](https://discourse.julialang.org/t/flux-jl-save-model-and-optimizer-from-gpu/89982 "2022-11-09T21:06:05Z")

</div>

I am trying to save my Flux.jl model and the optimizer to disk. This seems to work just fine when everything is on the CPU but I cannot get the optimizer out of the GPU. cpu(opt) doesn’t seem to do anything. Is this supp…

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

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