# Machine Learning

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

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

**Page:** 31

---

## [Seg Fault caused by loading a giant model](https://discourse.julialang.org/t/seg-fault-caused-by-loading-a-giant-model/69588)

<div class="topic-metadata">

**Author:** [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Replies:** 1\
**Last updated:** [October 13, 2021, 6:01pm UTC](https://discourse.julialang.org/t/seg-fault-caused-by-loading-a-giant-model/69588 "2021-10-13T18:01:24Z")

</div>

When using BSON, I am getting a seg fault when trying to load a saved model. Details below. The model is originally saved with: bson(savedir \* "policy.bson", policy = final\_policy) Then, in a different module, I am t…

---

## [TextModels PoSTagger error due to Flux.jl](https://discourse.julialang.org/t/textmodels-postagger-error-due-to-flux-jl/69514)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 3\
**Last updated:** [October 13, 2021, 3:44am UTC](https://discourse.julialang.org/t/textmodels-postagger-error-due-to-flux-jl/69514 "2021-10-13T03:44:39Z")

</div>

I have a problem with TextAnalysis PoSTagger. When I try to load PoSTagger: pos = PoSTagger() the following error occurs: ERROR: LoadError: MethodError: no method matching Flux.Conv(::typeof(identity), ::Array{Float3…

---

## [Transformers for NER classification](https://discourse.julialang.org/t/transformers-for-ner-classification/69300)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 9\
**Last updated:** [October 12, 2021, 6:07pm UTC](https://discourse.julialang.org/t/transformers-for-ner-classification/69300 "2021-10-12T18:07:15Z")

</div>

Hello. I am building a model for NER classification. Model is based on pre-trained BERT loaded with Transformers. I have some problems with the loss function. The problem is, that all losses are calculated only for the s…

---

## [(Flux) Moving data between cpu and gpu: "This intrinsic must be compiled to be called"](https://discourse.julialang.org/t/flux-moving-data-between-cpu-and-gpu-this-intrinsic-must-be-compiled-to-be-called/69595)

<div class="topic-metadata">

**Author:** [@c-state](https://discourse.julialang.org/u/c-state)\
**Replies:** 1\
**Last updated:** [October 12, 2021, 2:08am UTC](https://discourse.julialang.org/t/flux-moving-data-between-cpu-and-gpu-this-intrinsic-must-be-compiled-to-be-called/69595 "2021-10-12T02:08:35Z")

</div>

The title and example really say it all. I’m using Flux.jl version 0.12.7 and CUDA.jl 3.5.0. MWE: julia\> using Flux julia\> x = \[1, 2\] 2-element Vector{Int64}: 1 2 julia\> Flux.pullback(() -\> gpu(x)) ERROR: this intr…

---

## [Qs about trained model: (1) testmode! vs excluding Dropout layers; (2) size of BSON file](https://discourse.julialang.org/t/qs-about-trained-model-1-testmode-vs-excluding-dropout-layers-2-size-of-bson-file/69572)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 3\
**Last updated:** [October 11, 2021, 11:44pm UTC](https://discourse.julialang.org/t/qs-about-trained-model-1-testmode-vs-excluding-dropout-layers-2-size-of-bson-file/69572 "2021-10-11T23:44:07Z")

</div>

(1) I trained the NN model and want to use it further, i.e, load from the disk. What is the best way to predict: (i) with Flux.testmode! and Dropout layers; (ii) without Dropout layers and without Flux.testmode!? (2) My…

---

## [Cannot add DiffEqFlux (Julia v1.6) due to Enzyme failure](https://discourse.julialang.org/t/cannot-add-diffeqflux-julia-v1-6-due-to-enzyme-failure/69495)

<div class="topic-metadata">

**Author:** [@GregCoyle](https://discourse.julialang.org/u/GregCoyle)\
**Replies:** 1\
**Last updated:** [October 10, 2021, 4:26am UTC](https://discourse.julialang.org/t/cannot-add-diffeqflux-julia-v1-6-due-to-enzyme-failure/69495 "2021-10-10T04:26:50Z")

</div>

I am trying to follow the doc examples for DiffEqFlux and adding the package to a fresh project returns: (UDEs) pkg\> up Updating registry at \`C:\\Users\\...\\.julia\\registries\\General\` Updating git-repo \`https://gi…

---

## [Flux callback using accuracy not found](https://discourse.julialang.org/t/flux-callback-using-accuracy-not-found/69429)

<div class="topic-metadata">

**Author:** [@FrootLoops](https://discourse.julialang.org/u/FrootLoops)\
**Replies:** 2\
**Last updated:** [October 9, 2021, 5:47am UTC](https://discourse.julialang.org/t/flux-callback-using-accuracy-not-found/69429 "2021-10-09T05:47:47Z")

</div>

Hi, I start to work with the Flux.jl to create neural networks. Using the documentation Flux\_Callback I wanted touse a callback for a train model. Using the suggested callback cb = function () accuracy() \> 0.9 && Fl…

---

## [Problem defining a Neural Network with gradient as Loss function](https://discourse.julialang.org/t/problem-defining-a-neural-network-with-gradient-as-loss-function/69164)

<div class="topic-metadata">

**Author:** [@munozariasjm](https://discourse.julialang.org/u/munozariasjm)\
**Replies:** 1\
**Last updated:** [October 8, 2021, 9:26pm UTC](https://discourse.julialang.org/t/problem-defining-a-neural-network-with-gradient-as-loss-function/69164 "2021-10-08T21:26:52Z")

</div>

Hi, I’m trying to setup a simple network who’s Loss Function is the Laplacian of the NN with respect to the gradient. Then, the loss function is: function 𝕃1(x) f(j) = NNsolver(j) #Output of the NN ∇²(n) = Zygo…

---

## [LoadError: Can't differentiate loopinfo expression](https://discourse.julialang.org/t/loaderror-cant-differentiate-loopinfo-expression/69067)

<div class="topic-metadata">

**Author:** [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Replies:** 8\
**Last updated:** [October 4, 2021, 7:17pm UTC](https://discourse.julialang.org/t/loaderror-cant-differentiate-loopinfo-expression/69067 "2021-10-04T19:17:53Z")

</div>

When trying to run the code: (from an example) using DeepQLearning using POMDPs using Flux using POMDPModels using POMDPSimulators using POMDPPolicies # load MDP model from POMDPModels or define your own! mdp = SimpleG…

---

## [I encountered a problem when using a convolutional neural network for training](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087)

<div class="topic-metadata">

**Author:** [@wondering](https://discourse.julialang.org/u/wondering)\
**Replies:** 0\
**Last updated:** [October 2, 2021, 3:23am UTC](https://discourse.julialang.org/t/i-encountered-a-problem-when-using-a-convolutional-neural-network-for-training/69087 "2021-10-02T03:23:53Z")

</div>

My task contains two neural networks. There is an MLP (Multilayer Perceptron) network named Model\_out in front, and its parameters are stored in: p\_out, re\_out = Flux.destructure(model\_out), and split\_i = length(p\_out); …

---

## [Understanding Flux.jl use of \`gradient\` and \`params\`](https://discourse.julialang.org/t/understanding-flux-jl-use-of-gradient-and-params/69077)

<div class="topic-metadata">

**Author:** [@davibarreira](https://discourse.julialang.org/u/davibarreira)\
**Replies:** 4\
**Last updated:** [October 2, 2021, 4:54pm UTC](https://discourse.julialang.org/t/understanding-flux-jl-use-of-gradient-and-params/69077 "2021-10-02T16:54:23Z")

</div>

I’m reading the “60-minutes blitz” for Flux, and I’m trying to understand more deeply how the package works. Now, I have the following code: using Flux: params W = randn(3, 5) b = zeros(3) x = \[3,1,0,1,2\] y(x) = sum(…

---

## [Why are flux models declared in top-level scope?](https://discourse.julialang.org/t/why-are-flux-models-declared-in-top-level-scope/68954)

<div class="topic-metadata">

**Author:** [@htmj](https://discourse.julialang.org/u/htmj)\
**Replies:** 4\
**Last updated:** [October 1, 2021, 8:48pm UTC](https://discourse.julialang.org/t/why-are-flux-models-declared-in-top-level-scope/68954 "2021-10-01T20:48:28Z")

</div>

From what I understand, one of the big things to avoid in julia is to have stuff be in the global scope (at least unless they are declared constant). In addition I don’t understand how i’m supposed to have several “inst…

---

## [Uploading vector of vectors to GPU in flux.jl](https://discourse.julialang.org/t/uploading-vector-of-vectors-to-gpu-in-flux-jl/68552)

<div class="topic-metadata">

**Author:** [@mys\_721tx](https://discourse.julialang.org/u/mys_721tx)\
**Replies:** 4\
**Last updated:** [October 1, 2021, 5:55pm UTC](https://discourse.julialang.org/t/uploading-vector-of-vectors-to-gpu-in-flux-jl/68552 "2021-10-01T17:55:52Z")

</div>

Hello all, I am training a many-to-many RNN. My input and output data are both Vector{Vector{Vector{Float32}}}. The jld file of the input and output is about 3GB. I checked the model-zoo and did not find anything exampl…

---

## [Problems using BacksolveAdjoint for an SDE with DiffEqFlux](https://discourse.julialang.org/t/problems-using-backsolveadjoint-for-an-sde-with-diffeqflux/68049)

<div class="topic-metadata">

**Author:** [@JoseG](https://discourse.julialang.org/u/JoseG)\
**Replies:** 5\
**Last updated:** [September 29, 2021, 1:15pm UTC](https://discourse.julialang.org/t/problems-using-backsolveadjoint-for-an-sde-with-diffeqflux/68049 "2021-09-29T13:15:19Z")

</div>

I’m trying to train a SDE with DiffEqFlux. I had issues with stack overflows when using TrackerAdjoint (probably because of the size of the problem), so i tried using BacksolveAdjoint but this errors on calculating the g…

---

## [Calling Flux.params() inside gradient changes output?](https://discourse.julialang.org/t/calling-flux-params-inside-gradient-changes-output/68829)

<div class="topic-metadata">

**Author:** [@AlexLewandowski](https://discourse.julialang.org/u/AlexLewandowski)\
**Replies:** 2\
**Last updated:** [September 28, 2021, 6:32pm UTC](https://discourse.julialang.org/t/calling-flux-params-inside-gradient-changes-output/68829 "2021-09-28T18:32:16Z")

</div>

Could anyone help me understand why calling Flux.params() inside a gradient, changes the gradient? Below is a minimal example where, in get\_grad\_2, I instantiate a variable prowling\_variable = Flux.params(m). The gradie…

---

## [Using Flux to construct a CES function](https://discourse.julialang.org/t/using-flux-to-construct-a-ces-function/68842)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 3\
**Last updated:** [September 28, 2021, 4:32pm UTC](https://discourse.julialang.org/t/using-flux-to-construct-a-ces-function/68842 "2021-09-28T16:32:13Z")

</div>

I’m wondering if I Flux.jl can be used to construct a multi layer CES function. I won’t be training the function in Flux, just leverage its multi layer flexibility. For example, consider the function F(x; a, \\rho) = \\l…

---

## [What does the architecture of Flux.RNN look like?](https://discourse.julialang.org/t/what-does-the-architecture-of-flux-rnn-look-like/44119)

<div class="topic-metadata">

**Author:** [@XiaodongMa-MRI](https://discourse.julialang.org/u/XiaodongMa-MRI)\
**Replies:** 2\
**Last updated:** [September 27, 2021, 10:06pm UTC](https://discourse.julialang.org/t/what-does-the-architecture-of-flux-rnn-look-like/44119 "2021-09-27T22:06:17Z")

</div>

Hi all, I am confused about the architecture of RNN in Flux.jl. If I define a RNN using the code RNN(3,3), will it be like the left one or the right one in the picture below? Based on the documentation, I think it is…

---

## [Using AbstractEnv from CommonRLInterface with POMDPs](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730)

<div class="topic-metadata">

**Author:** [@Tyler\_Ingebrand](https://discourse.julialang.org/u/Tyler_Ingebrand)\
**Replies:** 22\
**Last updated:** [September 27, 2021, 9:47pm UTC](https://discourse.julialang.org/t/using-abstractenv-from-commonrlinterface-with-pomdps/68730 "2021-09-27T21:47:06Z")

</div>

Hello. I am trying to use reinforcement learning to solve a simple problem as a proof of concept. I am using DeepQLearning and defining the AbstractEnv(an interface from CommonRLInterface). I am getting the following err…

---

## [Rs Dmnorm equivalent in Julia](https://discourse.julialang.org/t/rs-dmnorm-equivalent-in-julia/68773)

<div class="topic-metadata">

**Author:** [@djholiver](https://discourse.julialang.org/u/djholiver)\
**Replies:** 2\
**Last updated:** [September 26, 2021, 11:08am UTC](https://discourse.julialang.org/t/rs-dmnorm-equivalent-in-julia/68773 "2021-09-26T11:08:08Z")

</div>

Hi, I am very new to statistical computing but have a need to convert an R script to Julia to mitigate high memory usage and performance challenges. I have been able to clean up quite a bit so far but the below is a sti…

---

## [Hyperbolic Deep Learning](https://discourse.julialang.org/t/hyperbolic-deep-learning/45895)

<div class="topic-metadata">

**Author:** [@tbreloff](https://discourse.julialang.org/u/tbreloff)\
**Replies:** 4\
**Last updated:** [September 25, 2021, 12:26am UTC](https://discourse.julialang.org/t/hyperbolic-deep-learning/45895 "2021-09-25T00:26:31Z")

</div>

Are there any active communities working in the space of hyperbolic deep learning? I’m specifically interested in Flux-compatible libraries which define the basic DL operations for either the Poincare or Lorentz hyperbol…

---

## [Error when trying to run /FluxML/model-zoo/vision/vae\_mnist/vae\_mnist.jl on newer versions of CUDA, Flux](https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300)

<div class="topic-metadata">

**Author:** [@tylerjthomas9](https://discourse.julialang.org/u/tylerjthomas9)\
**Replies:** 1\
**Last updated:** [September 24, 2021, 12:28am UTC](https://discourse.julialang.org/t/error-when-trying-to-run-fluxml-model-zoo-vision-vae-mnist-vae-mnist-jl-on-newer-versions-of-cuda-flux/68300 "2021-09-24T00:28:58Z")

</div>

I’m trying to run the file found here: https://github.com/FluxML/model-zoo/blob/master/vision/vae\_mnist/vae\_mnist.jl on newer versions of Flux, CUDA. CUDA = v3.4.2 Flux = v0.12.6 Do you know what could be causing erro…

---

## [Flattened data vs Flux.flatten layer](https://discourse.julialang.org/t/flattened-data-vs-flux-flatten-layer/68650)

<div class="topic-metadata">

**Author:** [@congUoM](https://discourse.julialang.org/u/congUoM)\
**Replies:** 2\
**Last updated:** [September 23, 2021, 11:40pm UTC](https://discourse.julialang.org/t/flattened-data-vs-flux-flatten-layer/68650 "2021-09-23T23:40:20Z")

</div>

Hi all, I am trying to use the following MLP model (for MNIST) in the model zoo as a template for my work, and I have this problem: https://github.com/FluxML/model-zoo/blob/master/vision/mlp\_mnist/mlp\_mnist.jl I remo…

---

## [How to model seasonal data using GLM.jl](https://discourse.julialang.org/t/how-to-model-seasonal-data-using-glm-jl/46629)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 2\
**Last updated:** [September 23, 2021, 12:13pm UTC](https://discourse.julialang.org/t/how-to-model-seasonal-data-using-glm-jl/46629 "2021-09-23T12:13:05Z")

</div>

I would like to model some data that exhibits strong hourly seasonality. Additionally the data depends on the ambient temperature and if it is a holiday or workday. @formula(y ~ 1 + T\_amb + T\_amb^2 + hour\_of\_day(t)) O…

---

## [Flux.gradient returns dict of param and Nothing](https://discourse.julialang.org/t/flux-gradient-returns-dict-of-param-and-nothing/68457)

<div class="topic-metadata">

**Author:** [@sanderbboisen](https://discourse.julialang.org/u/sanderbboisen)\
**Replies:** 3\
**Last updated:** [September 22, 2021, 4:09pm UTC](https://discourse.julialang.org/t/flux-gradient-returns-dict-of-param-and-nothing/68457 "2021-09-22T16:09:26Z")

</div>

Hi everyone, I am fairly new to Julia and Flux and I am trying to implement a WGAN-variant that I have implemented in Keras before. Full code for the issue can be found here. I keep getting gradients that consist of pa…

---

## [DataLoaders.jl Workers systematically end up outside bounds](https://discourse.julialang.org/t/dataloaders-jl-workers-systematically-end-up-outside-bounds/62928)

<div class="topic-metadata">

**Author:** [@ClarkGuilty](https://discourse.julialang.org/u/ClarkGuilty)\
**Replies:** 3\
**Last updated:** [September 22, 2021, 9:55am UTC](https://discourse.julialang.org/t/dataloaders-jl-workers-systematically-end-up-outside-bounds/62928 "2021-09-22T09:55:35Z")

</div>

Hello fellow Julians. I am trying to train a model using a parallel DataLoader, however, following the example from the documentation (available here: https://github.com/lorenzoh/DataLoaders.jl/blob/master/docs/dataconta…

---

## [I've made a small step-by-step tutorial to using Flux for image recognition](https://discourse.julialang.org/t/ive-made-a-small-step-by-step-tutorial-to-using-flux-for-image-recognition/68261)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 6\
**Last updated:** [September 17, 2021, 4:09pm UTC](https://discourse.julialang.org/t/ive-made-a-small-step-by-step-tutorial-to-using-flux-for-image-recognition/68261 "2021-09-17T16:09:55Z")

</div>

I was trying to model a simple character recognition in Flux and almost lost my sanity due to the lack of tutorials and the ones that do exist were quite outdated. So after some head banging I’ve made a small tutorial to…

---

## [Package for multi label classification](https://discourse.julialang.org/t/package-for-multi-label-classification/46156)

<div class="topic-metadata">

**Author:** [@Rajeev\_Gangal](https://discourse.julialang.org/u/Rajeev_Gangal)\
**Replies:** 2\
**Last updated:** [September 16, 2021, 5:11pm UTC](https://discourse.julialang.org/t/package-for-multi-label-classification/46156 "2021-09-16T17:11:35Z")

</div>

What’s the best ML package to use for multi-label classification in Julia? Hopefully, it will have multiple algorithms. Else, do suggest particular packages too. MLJ? Flux? or TensorFlow etc

---

## [Running a pre-trained BERT on twitter data using Flux.jl Transformer.jl](https://discourse.julialang.org/t/running-a-pre-trained-bert-on-twitter-data-using-flux-jl-transformer-jl/67721)

<div class="topic-metadata">

**Author:** [@Storopoli](https://discourse.julialang.org/u/Storopoli)\
**Replies:** 17\
**Last updated:** [September 16, 2021, 9:24am UTC](https://discourse.julialang.org/t/running-a-pre-trained-bert-on-twitter-data-using-flux-jl-transformer-jl/67721 "2021-09-16T09:24:41Z")

</div>

Hi everybody! I have 8k labelled twitter data with either a 0 or 1 (binary classification). MLJ.jl with classical machine learning has not very good performance with the problem. I am trying to fit a pre-trained BERT t…

---

## [Issues with recurrent layers in Flux.jl](https://discourse.julialang.org/t/issues-with-recurrent-layers-in-flux-jl/67815)

<div class="topic-metadata">

**Author:** [@shindler25](https://discourse.julialang.org/u/shindler25)\
**Replies:** 8\
**Last updated:** [September 13, 2021, 4:26pm UTC](https://discourse.julialang.org/t/issues-with-recurrent-layers-in-flux-jl/67815 "2021-09-13T16:26:48Z")

</div>

I am using Julia 1.6 and Flux v0.12.6 I am having issues using the recurrent layers LSTM and RNN in Flux.jl and it does not make sense why this is happening. hopefully someone can see where it is going wrong? I define …

---

## [Save Random Forest Model for Use in Android Application](https://discourse.julialang.org/t/save-random-forest-model-for-use-in-android-application/32400)

<div class="topic-metadata">

**Author:** [@casstrong](https://discourse.julialang.org/u/casstrong)\
**Replies:** 0\
**Last updated:** [December 17, 2019, 7:31pm UTC](https://discourse.julialang.org/t/save-random-forest-model-for-use-in-android-application/32400 "2019-12-17T19:31:19Z")

</div>

I would like to train a random forest classifier (using DecisionTree.jl) and then export it for use in an Android application that I’m developing. I’ve seen ways to save the model as a .jld or a .jld2 file; however, I ha…

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

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