# Machine Learning

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

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

**Page:** 21

---

## [Model options for numeric and categorical](https://discourse.julialang.org/t/model-options-for-numeric-and-categorical/89872)

<div class="topic-metadata">

**Author:** [@Billpete002](https://discourse.julialang.org/u/Billpete002)\
**Replies:** 1\
**Last updated:** [November 8, 2022, 1:34am UTC](https://discourse.julialang.org/t/model-options-for-numeric-and-categorical/89872 "2022-11-08T01:34:14Z")

</div>

Hi All, I am wondering if there is something similar in Julia to Python’s Catboost, i.e. a gradient boosted determinant model that allows for categorical and numeric data? I found a Catboost.jl package, but it is relia…

---

## [Misbehaving model / bad neural net architecture for the job?](https://discourse.julialang.org/t/misbehaving-model-bad-neural-net-architecture-for-the-job/89729)

<div class="topic-metadata">

**Author:** [@chrisoei](https://discourse.julialang.org/u/chrisoei)\
**Replies:** 2\
**Last updated:** [November 5, 2022, 3:12pm UTC](https://discourse.julialang.org/t/misbehaving-model-bad-neural-net-architecture-for-the-job/89729 "2022-11-05T15:12:29Z")

</div>

So I thought I’d take the Universal Approximation Theorem for a spin by training a neural net to reproduce the U.S. Consumer Price Index as a function of time: A simple model with 1 hidden layer with 3 neurons does ju…

---

## [Create a layer in Flux](https://discourse.julialang.org/t/create-a-layer-in-flux/89468)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 4\
**Last updated:** [November 4, 2022, 7:00pm UTC](https://discourse.julialang.org/t/create-a-layer-in-flux/89468 "2022-11-04T19:00:07Z")

</div>

What are the best practices for creating a custom layer in Flux? I noticed that, for example, creating a layer with internal state is not trivial. What should I do in general if I want to create a layer?

---

## [Flux and Octavian](https://discourse.julialang.org/t/flux-and-octavian/89770)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [November 4, 2022, 10:06am UTC](https://discourse.julialang.org/t/flux-and-octavian/89770 "2022-11-04T10:06:51Z")

</div>

Does Flux use Octavian when run on cpu?

---

## [Linear Regression step by step for newcomers](https://discourse.julialang.org/t/linear-regression-step-by-step-for-newcomers/89621)

<div class="topic-metadata">

**Author:** [@Troiss](https://discourse.julialang.org/u/Troiss)\
**Replies:** 7\
**Last updated:** [November 2, 2022, 9:00am UTC](https://discourse.julialang.org/t/linear-regression-step-by-step-for-newcomers/89621 "2022-11-02T09:00:44Z")

</div>

Hello. I’m very new to machine and even newer to Julia, as a whole, thought the syntax is still easy to understand. I got a task to train linear regression a set of data (X, y), in which X is the matrix of input vectors,…

---

## [Flux - LSTM - Issue with input format for multiple features](https://discourse.julialang.org/t/flux-lstm-issue-with-input-format-for-multiple-features/55272)

<div class="topic-metadata">

**Author:** [@thomaszub](https://discourse.julialang.org/u/thomaszub)\
**Replies:** 9\
**Last updated:** [November 1, 2022, 7:52pm UTC](https://discourse.julialang.org/t/flux-lstm-issue-with-input-format-for-multiple-features/55272 "2022-11-01T19:52:54Z")

</div>

Hi community, I’m diving into machine learning in Julia and currently having some issues with the input format for a LSTM model. The target is to predict the current activity of a human based on motion data from a smart…

---

## [Discrepancy between lme4 and GLM.jl](https://discourse.julialang.org/t/discrepancy-between-lme4-and-glm-jl/85601)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 7\
**Last updated:** [November 1, 2022, 4:18pm UTC](https://discourse.julialang.org/t/discrepancy-between-lme4-and-glm-jl/85601 "2022-11-01T16:18:30Z")

</div>

There I was, happily running thousands of linear models with GLM.jl, but the results didn’t seem quite right. For one thing, all of my p-values were exceptionally low (\>90% of features significant, even after FDR correct…

---

## [Precompiling Flux](https://discourse.julialang.org/t/precompiling-flux/89577)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [October 31, 2022, 7:43pm UTC](https://discourse.julialang.org/t/precompiling-flux/89577 "2022-10-31T19:43:54Z")

</div>

I am working on the Mac with Julia 1.8.2 in Visual Code. I installed Flux, but when adding it via the package manager using \\ followed by add, I get the following error: ERROR: LoadError: UndefVarError: IndicesInfo not …

---

## [Do we need to apply weights if we are using the AUC PR for imbalanced data?](https://discourse.julialang.org/t/do-we-need-to-apply-weights-if-we-are-using-the-auc-pr-for-imbalanced-data/89533)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [October 30, 2022, 10:58pm UTC](https://discourse.julialang.org/t/do-we-need-to-apply-weights-if-we-are-using-the-auc-pr-for-imbalanced-data/89533 "2022-10-30T22:58:16Z")

</div>

If we want to apply a classification model to imbalanced data we should Apply weights to the classes or use a cost matrix. Use the metrics more robust to imbalance, for example the AUC PR better than the AUC ROC, and t…

---

## [Gradient on GPU 70X slower than on CPU](https://discourse.julialang.org/t/gradient-on-gpu-70x-slower-than-on-cpu/89407)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 13\
**Last updated:** [October 28, 2022, 9:39pm UTC](https://discourse.julialang.org/t/gradient-on-gpu-70x-slower-than-on-cpu/89407 "2022-10-28T21:39:59Z")

</div>

I just started using Flux.jl. I have a loss function whose gradient is calculated much slower on GPU than on CPU. As a machine learning project typically involves a large dataset, it is difficult to create a MWE, but I…

---

## [Saving multiple MLJ machine to a single file?](https://discourse.julialang.org/t/saving-multiple-mlj-machine-to-a-single-file/89269)

<div class="topic-metadata">

**Author:** [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Replies:** 5\
**Last updated:** [October 31, 2022, 1:25am UTC](https://discourse.julialang.org/t/saving-multiple-mlj-machine-to-a-single-file/89269 "2022-10-31T01:25:58Z")

</div>

Is it possible to save/load multiple trained MLJ machine to a single file to ease file management? Using JLD2 seems to generate a huge file (40GB using JLD2 compared to 40MB when using MLJ.save).

---

## [Flux Chain function](https://discourse.julialang.org/t/flux-chain-function/89369)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 11:12pm UTC](https://discourse.julialang.org/t/flux-chain-function/89369 "2022-10-27T23:12:03Z")

</div>

Why does the Chain function not warn if the output of one layer is not compatible with the imput of the next?

---

## [Translating a basic MNIST tensorflow network into an MLJFlux builder](https://discourse.julialang.org/t/translating-a-basic-mnist-tensorflow-network-into-an-mljflux-builder/89338)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 1\
**Last updated:** [October 27, 2022, 12:08am UTC](https://discourse.julialang.org/t/translating-a-basic-mnist-tensorflow-network-into-an-mljflux-builder/89338 "2022-10-27T00:08:20Z")

</div>

On slack I have been asked: How does one translate the following into MLJFlux. The code is from this tensorflow tutorial on the MNIST dataset for beginners. model = tf.keras.models.Sequential(\[ tf.keras.layers.Flat…

---

## [Nonlinear activation functions (and Transformers) on the way out?! And "SimpleGate" the replacement](https://discourse.julialang.org/t/nonlinear-activation-functions-and-transformers-on-the-way-out-and-simplegate-the-replacement/80127)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [October 26, 2022, 8:23am UTC](https://discourse.julialang.org/t/nonlinear-activation-functions-and-transformers-on-the-way-out-and-simplegate-the-replacement/80127 "2022-10-26T08:23:53Z")

</div>

our SimpleGate could be implemented by an element-wise multiplication, that’s all: SimpleGate(X, Y) = X ⊙ Y where X and Y are feature maps of the same size. What caught my eye first was: https://arxiv.org/pdf/2204…

---

## [Siamese network in Lux.jl / Re-using parts of network](https://discourse.julialang.org/t/siamese-network-in-lux-jl-re-using-parts-of-network/82013)

<div class="topic-metadata">

**Author:** [@svilupp](https://discourse.julialang.org/u/svilupp)\
**Replies:** 10\
**Last updated:** [October 24, 2022, 4:46pm UTC](https://discourse.julialang.org/t/siamese-network-in-lux-jl-re-using-parts-of-network/82013 "2022-10-24T16:46:38Z")

</div>

Hi everyone! Have you seen any examples of re-using parts of the networks in Lux.jl? I haven’t been able to find anything. I’ve been trying to put a toy example of Siamese network (ala Keras - Siamese Contrastive Loss,…

---

## [Lux and Flux GPU function definitions overlap](https://discourse.julialang.org/t/lux-and-flux-gpu-function-definitions-overlap/89149)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [October 24, 2022, 1:39pm UTC](https://discourse.julialang.org/t/lux-and-flux-gpu-function-definitions-overlap/89149 "2022-10-24T13:39:13Z")

</div>

I am running the NeuralODE example for GPUs. Here is the code: using DifferentialEquations, Flux, DiffEqFlux, SciMLSensitivity using Random rng = Random.default\_rng() model\_gpu = Chain(Dense(2, 50, tanh), Dense(50, 2)…

---

## [Error running highdim\_pde script from 2019 on 2022 SciML versions](https://discourse.julialang.org/t/error-running-highdim-pde-script-from-2019-on-2022-sciml-versions/89093)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 12\
**Last updated:** [October 23, 2022, 3:33pm UTC](https://discourse.julialang.org/t/error-running-highdim-pde-script-from-2019-on-2022-sciml-versions/89093 "2022-10-23T15:33:50Z")

</div>

I am trying to run the “Universal Differential Equations” demos posted at the github repository: GitHub - ChrisRackauckas/universal\_differential\_equations: Repository for the Universal Differential Equations for Scienti…

---

## [Error when running a simple ANN model in Flux](https://discourse.julialang.org/t/error-when-running-a-simple-ann-model-in-flux/88890)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [October 19, 2022, 3:41pm UTC](https://discourse.julialang.org/t/error-when-running-a-simple-ann-model-in-flux/88890 "2022-10-19T15:41:49Z")

</div>

Hi I am trying to run a simple ANN model in flux but having trouble with understanding the errors. Any idea what I am doing incorrectly # Shapes : X\_train : (204,2) , X\_val : (51,2), y\_train : (204,3), y\_val : (51,3) #…

---

## [Non-convex loss functions with Flux.jl](https://discourse.julialang.org/t/non-convex-loss-functions-with-flux-jl/88273)

<div class="topic-metadata">

**Author:** [@MattSainsbury-Dale](https://discourse.julialang.org/u/MattSainsbury-Dale)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 3:19am UTC](https://discourse.julialang.org/t/non-convex-loss-functions-with-flux-jl/88273 "2022-10-18T03:19:49Z")

</div>

I am interested in training a Flux neural network under a non-convex loss function. Specifically, the loss function L\_P(x, y) = (|x - y|)^P for some 0 \< P \< 1, which is implemented in LossFunctions.jl as LPDistLoss. Is…

---

## [How to efficiently evaluate a Flux.jl neural network millions of times on the GPU?](https://discourse.julialang.org/t/how-to-efficiently-evaluate-a-flux-jl-neural-network-millions-of-times-on-the-gpu/88864)

<div class="topic-metadata">

**Author:** [@PolarizedPoutine](https://discourse.julialang.org/u/PolarizedPoutine)\
**Replies:** 3\
**Last updated:** [October 17, 2022, 7:36pm UTC](https://discourse.julialang.org/t/how-to-efficiently-evaluate-a-flux-jl-neural-network-millions-of-times-on-the-gpu/88864 "2022-10-17T19:36:04Z")

</div>

I have trained a small Flux.jl neural network that I am embedding into a larger model but I need to use the neural network to make millions (billions?) of predictions as part of running this larger model. Since the larg…

---

## [Flux Get Forward Pass Results when Taking Gradient](https://discourse.julialang.org/t/flux-get-forward-pass-results-when-taking-gradient/88805)

<div class="topic-metadata">

**Author:** [@tawheeler](https://discourse.julialang.org/u/tawheeler)\
**Replies:** 3\
**Last updated:** [October 16, 2022, 4:41pm UTC](https://discourse.julialang.org/t/flux-get-forward-pass-results-when-taking-gradient/88805 "2022-10-16T16:41:14Z")

</div>

I was hoping to keep track of loss values while running training with Flux.jl. However, so far I have been unable to both evaluate my loss gradient and evaluate my loss at the same time. I have to run them separately: ℓ…

---

## [MLFlow Integration](https://discourse.julialang.org/t/mlflow-integration/88320)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 3\
**Last updated:** [October 12, 2022, 4:48pm UTC](https://discourse.julialang.org/t/mlflow-integration/88320 "2022-10-12T16:48:10Z")

</div>

I found this project and was wondering if anyone is familiar with it and whether any Julia ML framework had plans to provide integration with it.

---

## [Conformal Predictive distributions](https://discourse.julialang.org/t/conformal-predictive-distributions/88067)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 21\
**Last updated:** [October 11, 2022, 4:36pm UTC](https://discourse.julialang.org/t/conformal-predictive-distributions/88067 "2022-10-11T16:36:04Z")

</div>

Note: this is updated code (corrects bugs in previous versions) Recently, there has been a rise in interest in “prior-free posterior distributions”. There is a related neat new package ConformalPrediction.jl (by @pat-a…

---

## [Order of edges in FeaturedGraph](https://discourse.julialang.org/t/order-of-edges-in-featuredgraph/88052)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 4\
**Last updated:** [October 10, 2022, 5:56am UTC](https://discourse.julialang.org/t/order-of-edges-in-featuredgraph/88052 "2022-10-10T05:56:39Z")

</div>

Hi, I am trying to understand FeaturedGraph from GraphSignals.jl. I am puzzled with the documentation, which says that features of edges are stored in matrix, where each column corresponds to a feature of one edge, but …

---

## [Differentiable argmin? Trying VQ-VAE in Flux.jl](https://discourse.julialang.org/t/differentiable-argmin-trying-vq-vae-in-flux-jl/88424)

<div class="topic-metadata">

**Author:** [@afishy](https://discourse.julialang.org/u/afishy)\
**Replies:** 4\
**Last updated:** [October 10, 2022, 2:51am UTC](https://discourse.julialang.org/t/differentiable-argmin-trying-vq-vae-in-flux-jl/88424 "2022-10-10T02:51:08Z")

</div>

I’m trying to follow this VQ-VAE tutorial in Julia, particularly the VectorQuantizer module: # Calculate distances distances = (torch.sum(flat\_input\*\*2, dim=1, keepdim=True) + torch.…

---

## [XGBoost reduce overfitting | k-fold cross validation](https://discourse.julialang.org/t/xgboost-reduce-overfitting-k-fold-cross-validation/88423)

<div class="topic-metadata">

**Author:** [@Seth16225](https://discourse.julialang.org/u/Seth16225)\
**Replies:** 1\
**Last updated:** [October 8, 2022, 12:25pm UTC](https://discourse.julialang.org/t/xgboost-reduce-overfitting-k-fold-cross-validation/88423 "2022-10-08T12:25:06Z")

</div>

Hello, I’m pretty new to machine learning, and I was using XGBoost.jl Regression. I’m in the process of trying to reduce overfitting through k-fold cross validation. I came across the nfold\_cv function, and I was wonder…

---

## [PhysicsInformedNN: sampling strategy for pde\_loss evaluation on pre-defined could points](https://discourse.julialang.org/t/physicsinformednn-sampling-strategy-for-pde-loss-evaluation-on-pre-defined-could-points/88238)

<div class="topic-metadata">

**Author:** [@LeoCott](https://discourse.julialang.org/u/LeoCott)\
**Replies:** 1\
**Last updated:** [October 4, 2022, 10:01pm UTC](https://discourse.julialang.org/t/physicsinformednn-sampling-strategy-for-pde-loss-evaluation-on-pre-defined-could-points/88238 "2022-10-04T22:01:27Z")

</div>

Hello all, I am trying to solve an inverse problem with NeuralPDE as presented in the documentation here. I am wondering if it was possible to define a sampling strategy to evaluate the pde\_loss of the NeuralPDE.Physic…

---

## [\[ANN\] BetaML v0.8: Model defininition, hyperparameters tuning and fitting in 2 lines](https://discourse.julialang.org/t/ann-betaml-v0-8-model-defininition-hyperparameters-tuning-and-fitting-in-2-lines/88119)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [October 3, 2022, 1:56pm UTC](https://discourse.julialang.org/t/ann-betaml-v0-8-model-defininition-hyperparameters-tuning-and-fitting-in-2-lines/88119 "2022-10-03T13:56:05Z")

</div>

Dear all, I’m pleased to announce BetaML v0.8. The Beta Machine Learning Toolkit is a package including many algorithms and utilities to implement machine learning workflows in Julia, with a detailed tutorial on its usa…

---

## [Is there a package for Derivative Observations](https://discourse.julialang.org/t/is-there-a-package-for-derivative-observations/88013)

<div class="topic-metadata">

**Author:** [@zdc063](https://discourse.julialang.org/u/zdc063)\
**Replies:** 0\
**Last updated:** [September 29, 2022, 10:27pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-derivative-observations/88013 "2022-09-29T22:27:37Z")

</div>

Hello everyone, It is well known that observations on derivatives can be used to train GP. (e.g. https://proceedings.neurips.cc/paper/2002/file/5b8e4fd39d9786228649a8a8bec4e008-Paper.pdf) I wonder whether there is any e…

---

## [Does Julia provide enough support for reinforcement learning now?](https://discourse.julialang.org/t/does-julia-provide-enough-support-for-reinforcement-learning-now/87964)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 8\
**Last updated:** [September 29, 2022, 5:26pm UTC](https://discourse.julialang.org/t/does-julia-provide-enough-support-for-reinforcement-learning-now/87964 "2022-09-29T17:26:34Z")

</div>

Does Julia provide enough support for reinforcement learning now? Is Julia the recommended language for reinforcement learning? Does it have any advantage over Python in this regard? If yes, how to get started to learn …

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

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