# Machine Learning

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

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

**Page:** 22

---

## [Problem with first example with Flux](https://discourse.julialang.org/t/problem-with-first-example-with-flux/87899)

<div class="topic-metadata">

**Author:** [@Richard\_Wright](https://discourse.julialang.org/u/Richard_Wright)\
**Replies:** 1\
**Last updated:** [September 28, 2022, 7:13am UTC](https://discourse.julialang.org/t/problem-with-first-example-with-flux/87899 "2022-09-28T07:13:44Z")

</div>

Hello, I am trying the very first example in flux from Overview · Flux. The code is given below. It works fine when hcat(0:5...) but doesn’t when hcat(0:6...). Why? using Flux using Flux: train! import Random Rando…

---

## [How to use/initialize Zygote.Buffer](https://discourse.julialang.org/t/how-to-use-initialize-zygote-buffer/87653)

<div class="topic-metadata">

**Author:** [@LeN3rd](https://discourse.julialang.org/u/LeN3rd)\
**Replies:** 3\
**Last updated:** [September 27, 2022, 2:52pm UTC](https://discourse.julialang.org/t/how-to-use-initialize-zygote-buffer/87653 "2022-09-27T14:52:10Z")

</div>

This is probably a common question, but when i use Zygote.Buffer i cannot assign values by doing buffer .= old\_data It throws the following: ERROR: MethodError: no method matching ndims(::Type{Zygote.Buffer{Float64, Ma…

---

## [Convex Neural Network Using Skip Layers in Flux.jl](https://discourse.julialang.org/t/convex-neural-network-using-skip-layers-in-flux-jl/87827)

<div class="topic-metadata">

**Author:** [@marcofrancis](https://discourse.julialang.org/u/marcofrancis)\
**Replies:** 5\
**Last updated:** [September 27, 2022, 8:30am UTC](https://discourse.julialang.org/t/convex-neural-network-using-skip-layers-in-flux-jl/87827 "2022-09-27T08:30:00Z")

</div>

Hi, I’m trying to code up the following net, where y is the input of my net, f(y) is the output of the net, W^z\_k, W^y\_k are matrices and b\_k are vectors : f(y) = z\_k z\_k = softplus(W^z\_k z\_{k-1}+W^y\_k y+b\_k) … z…

---

## [Wandb.jl hangs on first input prompt](https://discourse.julialang.org/t/wandb-jl-hangs-on-first-input-prompt/87838)

<div class="topic-metadata">

**Author:** [@afishy](https://discourse.julialang.org/u/afishy)\
**Replies:** 1\
**Last updated:** [September 27, 2022, 12:03am UTC](https://discourse.julialang.org/t/wandb-jl-hangs-on-first-input-prompt/87838 "2022-09-27T00:03:48Z")

</div>

I’m trying to use Weights and Biases with Julia, and the REPL hangs when I try and use it (on VSCode): using Wandb lg = WandbLogger(project=“wandb\_test”) global\_logger(lg) Any input I enter is stuck (numlock is o…

---

## [Reinforcement Learning Custom Gym error](https://discourse.julialang.org/t/reinforcement-learning-custom-gym-error/87818)

<div class="topic-metadata">

**Author:** [@chunky](https://discourse.julialang.org/u/chunky)\
**Replies:** 2\
**Last updated:** [September 26, 2022, 10:35pm UTC](https://discourse.julialang.org/t/reinforcement-learning-custom-gym-error/87818 "2022-09-26T22:35:47Z")

</div>

I’ve created a custom Gym environment using ReinforcementLearning.jl. I think it adheres to the guidance on the documentation \[ “How to write a customised environment” \] , but the trivial case to run my gym, using a rand…

---

## [Workaround for subarray/selectdim on gpu or how does Flux.Conv do it?](https://discourse.julialang.org/t/workaround-for-subarray-selectdim-on-gpu-or-how-does-flux-conv-do-it/87758)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 4\
**Last updated:** [September 25, 2022, 3:12am UTC](https://discourse.julialang.org/t/workaround-for-subarray-selectdim-on-gpu-or-how-does-flux-conv-do-it/87758 "2022-09-25T03:12:30Z")

</div>

I’m trying to do something similar to what Flux.Conv does. I’ve tried to use the Conv layer but it seems to be opinionated about how the array is structured and what it outputs and so doesn’t quite match with what I want…

---

## [How do I compute a multiclass F-score using MLJ?](https://discourse.julialang.org/t/how-do-i-compute-a-multiclass-f-score-using-mlj/78579)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 7\
**Last updated:** [September 23, 2022, 7:06am UTC](https://discourse.julialang.org/t/how-do-i-compute-a-multiclass-f-score-using-mlj/78579 "2022-09-23T07:06:44Z")

</div>

I received the above question in an email.

---

## [Failed prediction from BetaML DecisionTreeClassifier](https://discourse.julialang.org/t/failed-prediction-from-betaml-decisiontreeclassifier/87327)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 10\
**Last updated:** [September 22, 2022, 9:16pm UTC](https://discourse.julialang.org/t/failed-prediction-from-betaml-decisiontreeclassifier/87327 "2022-09-22T21:16:41Z")

</div>

I am trying to do inference on the Adult dataset, which has a binary response variable (income below or above $50k/year). Seemingly I am able to train a Decision Tree using the dataset (as loaded using Fairness.jl), but …

---

## [Flux on GPU too slow](https://discourse.julialang.org/t/flux-on-gpu-too-slow/87621)

<div class="topic-metadata">

**Author:** [@vkarystinos](https://discourse.julialang.org/u/vkarystinos)\
**Replies:** 5\
**Last updated:** [September 22, 2022, 8:10pm UTC](https://discourse.julialang.org/t/flux-on-gpu-too-slow/87621 "2022-09-22T20:10:51Z")

</div>

Hi, I am training a number of NNs with Flux and Cuda. However, the training procedure is not accelerated as expected on GPU. I used the CuIterator as described in the docs for GPU training. Any ideas on how can I acceler…

---

## [Network Not Updating, Flux Julia](https://discourse.julialang.org/t/network-not-updating-flux-julia/87350)

<div class="topic-metadata">

**Author:** [@Nishant\_Mohanty](https://discourse.julialang.org/u/Nishant_Mohanty)\
**Replies:** 6\
**Last updated:** [September 19, 2022, 7:19pm UTC](https://discourse.julialang.org/t/network-not-updating-flux-julia/87350 "2022-09-19T19:19:35Z")

</div>

Hello people. I am trying to implement an actor critic network using Flux. However for some reason my network is not being updated. Here is a sample from the code. state\_dim1 = 14 output\_dim = 1 function actor\_model(sta…

---

## [Tabular MDP/Q-learning solver: Reward Matrix R(s, a, s') vs. R(s, a)](https://discourse.julialang.org/t/tabular-mdp-q-learning-solver-reward-matrix-r-s-a-s-vs-r-s-a/87457)

<div class="topic-metadata">

**Author:** [@Richard\_Wright](https://discourse.julialang.org/u/Richard_Wright)\
**Replies:** 0\
**Last updated:** [September 19, 2022, 4:52am UTC](https://discourse.julialang.org/t/tabular-mdp-q-learning-solver-reward-matrix-r-s-a-s-vs-r-s-a/87457 "2022-09-19T04:52:51Z")

</div>

Hello Folks, I am using the POMDP package along with the TabularTDLearning package In the first part of the problem I worked out a 3D transition matrix T(s’, a, s) and a 2D reward matrix R(s, a). Then formulated it as …

---

## [Univariate feature selection](https://discourse.julialang.org/t/univariate-feature-selection/87414)

<div class="topic-metadata">

**Author:** [@lucasmsoares96](https://discourse.julialang.org/u/lucasmsoares96)\
**Replies:** 1\
**Last updated:** [September 18, 2022, 9:07pm UTC](https://discourse.julialang.org/t/univariate-feature-selection/87414 "2022-09-18T21:07:37Z")

</div>

I’m having trouble finding a feature selection using Univariate feature selection in Julia. In scikit-learn this is possible as follows: from sklearn.datasets import load\_iris from sklearn.feature\_selection import Selec…

---

## [LIBSVM vs sklearn](https://discourse.julialang.org/t/libsvm-vs-sklearn/87235)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 0\
**Last updated:** [September 13, 2022, 8:54pm UTC](https://discourse.julialang.org/t/libsvm-vs-sklearn/87235 "2022-09-13T20:54:38Z")

</div>

I’m trying to port the SVC-based modelling from python/sklearn to Julia using the LIBSVM.jl package. However, I noticed one strange thing. Sklearn SVC outperforms LIBSVM.jl, although both are based on the same libsvm lib…

---

## [Accessing T-Net in PointNet in Flux3D.jl](https://discourse.julialang.org/t/accessing-t-net-in-pointnet-in-flux3d-jl/87233)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 0\
**Last updated:** [September 13, 2022, 8:46pm UTC](https://discourse.julialang.org/t/accessing-t-net-in-pointnet-in-flux3d-jl/87233 "2022-09-13T20:46:08Z")

</div>

I have a question about PointNet in Flux3D.jl. In the original PointNet paper, the author trained the “T-net” to make PointNet invariant w.r.t. rigid transformations of input point clouds (red dashed box below): Is …

---

## [ReinforcementLearning Gym spaces](https://discourse.julialang.org/t/reinforcementlearning-gym-spaces/87061)

<div class="topic-metadata">

**Author:** [@chunky](https://discourse.julialang.org/u/chunky)\
**Replies:** 2\
**Last updated:** [September 13, 2022, 6:46am UTC](https://discourse.julialang.org/t/reinforcementlearning-gym-spaces/87061 "2022-09-13T06:46:51Z")

</div>

I have a C++ Gym exposed as a C .dll/.so whose API was originally designed to be used for a Python OpenAI Gym using ctypes. Specifically, this only relies on “Box” for both action and observation; the continuous, multidi…

---

## [Getting started with ReinforcementLearning.jl](https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011)

<div class="topic-metadata">

**Author:** [@bwanab](https://discourse.julialang.org/u/bwanab)\
**Replies:** 1\
**Last updated:** [September 10, 2022, 7:54am UTC](https://discourse.julialang.org/t/getting-started-with-reinforcementlearning-jl/87011 "2022-09-10T07:54:09Z")

</div>

In ReinforcementLearningAnIntroduction/notebooks/Chapter01\_Tic\_Tac\_Toe.jl in the Testing section there is the comment “I leave it as an exercise to change the select\_action to a greedy version and confirm that our traine…

---

## [Saving models in MLJ - only final ones without data](https://discourse.julialang.org/t/saving-models-in-mlj-only-final-ones-without-data/86873)

<div class="topic-metadata">

**Author:** [@julien\_goo](https://discourse.julialang.org/u/julien_goo)\
**Replies:** 3\
**Last updated:** [September 9, 2022, 5:58am UTC](https://discourse.julialang.org/t/saving-models-in-mlj-only-final-ones-without-data/86873 "2022-09-09T05:58:23Z")

</div>

Hi all, I have built ML pipelines using MLJ to predict on live data (randomforest models for now + time serie crossval + grid search of hyperparams). It works like a charm. However, I have a question. I have to seriali…

---

## [Memory challenges for Flux on Resnet](https://discourse.julialang.org/t/memory-challenges-for-flux-on-resnet/85385)

<div class="topic-metadata">

**Author:** [@jeremiedb](https://discourse.julialang.org/u/jeremiedb)\
**Replies:** 8\
**Last updated:** [September 7, 2022, 3:22pm UTC](https://discourse.julialang.org/t/memory-challenges-for-flux-on-resnet/85385 "2022-09-07T15:22:55Z")

</div>

I’m attempting to reproduce Resnet (from Metalhead.jl) on ImageNet performance through simple demos for a single GPU setup (I’m on a RTX A4000, 16Bg, ~6000 CUDA cores) and stumbled upon 2 memory related challenges. A fi…

---

## [Need some help in understanding zygote gradient](https://discourse.julialang.org/t/need-some-help-in-understanding-zygote-gradient/86781)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 2\
**Last updated:** [September 7, 2022, 3:18pm UTC](https://discourse.julialang.org/t/need-some-help-in-understanding-zygote-gradient/86781 "2022-09-07T15:18:27Z")

</div>

Hi, I met some troubles in understanding zygote gradient. for example: I plan to get the gradient for f(x) = x^2 at x = 5, and also sum the result of f(x) for each time let result = 0 f(x) = begin a = x^2 …

---

## [Zero gradient when using argmax](https://discourse.julialang.org/t/zero-gradient-when-using-argmax/86745)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 5\
**Last updated:** [September 4, 2022, 2:50pm UTC](https://discourse.julialang.org/t/zero-gradient-when-using-argmax/86745 "2022-09-04T14:50:35Z")

</div>

The following example shows a zero gradient (update! appears to do nothing), but if I change the argmax calls to sum calls, then the gradient is non-zero. Is argmax not supported, or is there some other thing wrong with …

---

## [Julia and the Game of Go](https://discourse.julialang.org/t/julia-and-the-game-of-go/86454)

<div class="topic-metadata">

**Author:** [@Ordens\_Ritter](https://discourse.julialang.org/u/Ordens_Ritter)\
**Replies:** 6\
**Last updated:** [August 31, 2022, 7:16am UTC](https://discourse.julialang.org/t/julia-and-the-game-of-go/86454 "2022-08-31T07:16:27Z")

</div>

Once I a while a start a new hobby project in Julia in the vacations. To learn Julia and have so fun and than always forget the most afterwards because I use Python in my day job. :frowning: (I don’t like the forgetting …

---

## [What is the Flux.flatten inverse operation?](https://discourse.julialang.org/t/what-is-the-flux-flatten-inverse-operation/86413)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 2\
**Last updated:** [August 27, 2022, 5:06am UTC](https://discourse.julialang.org/t/what-is-the-flux-flatten-inverse-operation/86413 "2022-08-27T05:06:12Z")

</div>

My input data is multivariate time series, so the input array is width x length x batch. It appears a Dense layer requires the data to be in a single dimension, so I thought this is what Flux.flatten is for. On the outpu…

---

## [State of machine learning in Julia](https://discourse.julialang.org/t/state-of-machine-learning-in-julia/74385)

<div class="topic-metadata">

**Author:** [@sethaxen](https://discourse.julialang.org/u/sethaxen)\
**Replies:** 60\
**Last updated:** [August 26, 2022, 4:34pm UTC](https://discourse.julialang.org/t/state-of-machine-learning-in-julia/74385 "2022-08-26T16:34:27Z")

</div>

After the Twitter space Q&A @logankilpatrick hosted yesterday on “The future of machine learning and why it looks a lot like Julia,” I thought it would be useful to accumulate some community responses to a few questions …

---

## [LSTM with convolution instead of matrix multiplication (ConvLSTM)](https://discourse.julialang.org/t/lstm-with-convolution-instead-of-matrix-multiplication-convlstm/86315)

<div class="topic-metadata">

**Author:** [@Dieter](https://discourse.julialang.org/u/Dieter)\
**Replies:** 1\
**Last updated:** [August 25, 2022, 11:24pm UTC](https://discourse.julialang.org/t/lstm-with-convolution-instead-of-matrix-multiplication-convlstm/86315 "2022-08-25T23:24:45Z")

</div>

Hello Community I have already used Julia for many tasks but not for machine learning purposes. Now, I would need a LSTM network, which uses internal convolutional operations (not convolved matrices as input). Such a n…

---

## [GPU performance problem of locally connected layer with Tullio](https://discourse.julialang.org/t/gpu-performance-problem-of-locally-connected-layer-with-tullio/85469)

<div class="topic-metadata">

**Author:** [@Rasmus\_Hoier](https://discourse.julialang.org/u/Rasmus_Hoier)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 8:01am UTC](https://discourse.julialang.org/t/gpu-performance-problem-of-locally-connected-layer-with-tullio/85469 "2022-08-23T08:01:34Z")

</div>

I am using Tullio.jl to implement a locally connected layer, which is like a convolutional layer except there isn’t any weight sharing. I found Tullio very useful for this task, but unfortunately there is a large gap in …

---

## [Flux GPU Error with Zygote](https://discourse.julialang.org/t/flux-gpu-error-with-zygote/86192)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 12:43pm UTC](https://discourse.julialang.org/t/flux-gpu-error-with-zygote/86192 "2022-08-23T12:43:38Z")

</div>

Hello, I want to build an encoder for text classification model. But some how I get errors when I call Flux.train! method. For the MWE: # Since this is a text based model, an embedding matrix Is needed - this can be p…

---

## [API choice: \`inversePredict(mod,Xnew)\` vs \`predict(mod,Xnew;inv=true)\`?](https://discourse.julialang.org/t/api-choice-inversepredict-mod-xnew-vs-predict-mod-xnew-inv-true/86123)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 12:01am UTC](https://discourse.julialang.org/t/api-choice-inversepredict-mod-xnew-vs-predict-mod-xnew-inv-true/86123 "2022-08-23T00:01:22Z")

</div>

For a ML library, which would be the arguments in favour to use a new specific function name for the inverse prediction for a model (e.g. a zero-mean/unit variance scaler), something like inversePrediction(mod,Xnew), and…

---

## [How do you train a machine on several datasets](https://discourse.julialang.org/t/how-do-you-train-a-machine-on-several-datasets/85952)

<div class="topic-metadata">

**Author:** [@hpaldan](https://discourse.julialang.org/u/hpaldan)\
**Replies:** 2\
**Last updated:** [August 22, 2022, 6:18am UTC](https://discourse.julialang.org/t/how-do-you-train-a-machine-on-several-datasets/85952 "2022-08-22T06:18:09Z")

</div>

Hello! I’m new to the MLJ package but I gather that a fundamental aspect is that when you create a machine object you also define the data for the object. I’m in a situation where I have several very large dataframes th…

---

## [Want to learn Reinforcement Learning from scratch for mini-project](https://discourse.julialang.org/t/want-to-learn-reinforcement-learning-from-scratch-for-mini-project/85836)

<div class="topic-metadata">

**Author:** [@Lighfe](https://discourse.julialang.org/u/Lighfe)\
**Replies:** 6\
**Last updated:** [August 17, 2022, 1:30pm UTC](https://discourse.julialang.org/t/want-to-learn-reinforcement-learning-from-scratch-for-mini-project/85836 "2022-08-17T13:30:03Z")

</div>

Hello everyone, I’m quite new to Julia but have some basic knowledge of other programming languages. As a project for myself I want to train an RL algorithm for a boardgame. It’s a push-your-luck type of game, where yo…

---

## [Why do some Flux models train in parallel but not others?](https://discourse.julialang.org/t/why-do-some-flux-models-train-in-parallel-but-not-others/85453)

<div class="topic-metadata">

**Author:** [@Lewis\_Hein](https://discourse.julialang.org/u/Lewis_Hein)\
**Replies:** 16\
**Last updated:** [August 10, 2022, 11:50pm UTC](https://discourse.julialang.org/t/why-do-some-flux-models-train-in-parallel-but-not-others/85453 "2022-08-10T23:50:55Z")

</div>

Why does training this model use as many CPUs as I ask it to: Chain( Conv((5, 5), imgsize\[end\]=\>6, relu), MaxPool((2, 2)), Conv((5, 5), 6=\>16, relu), MaxPool((2, 2)),…

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

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