# Machine Learning

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

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

**Page:** 46

---

## [Flux cannot save a parameters](https://discourse.julialang.org/t/flux-cannot-save-a-parameters/35642)

<div class="topic-metadata">

**Author:** [@Owolf](https://discourse.julialang.org/u/Owolf)\
**Replies:** 3\
**Last updated:** [March 16, 2020, 4:35pm UTC](https://discourse.julialang.org/t/flux-cannot-save-a-parameters/35642 "2020-03-16T16:35:30Z")

</div>

Dear Julia community, I am trying to save parameters for trained RNN with BSON. However it seems that in latest version of FLUX this is not possible, however https://fluxml.ai says something different. I create rnn as: …

---

## [Simple optimization problem via flux](https://discourse.julialang.org/t/simple-optimization-problem-via-flux/35805)

<div class="topic-metadata">

**Author:** [@samantp](https://discourse.julialang.org/u/samantp)\
**Replies:** 0\
**Last updated:** [March 10, 2020, 5:41pm UTC](https://discourse.julialang.org/t/simple-optimization-problem-via-flux/35805 "2020-03-10T17:41:37Z")

</div>

I have a prediction function, called NTCP which takes several fixed input parameters: dpf,nf,ab. It also takes in some parameters that I am looking to optimize: n, TD, Y as well as my input data dvh\_all. The fixed parame…

---

## [Is it possible perform reverse mode differentiation (Flux.jl with Zygote.jl) of a forward mode differentiation result (e.g. ForwardDiff)?](https://discourse.julialang.org/t/is-it-possible-perform-reverse-mode-differentiation-flux-jl-with-zygote-jl-of-a-forward-mode-differentiation-result-e-g-forwarddiff/30945)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 3\
**Last updated:** [March 10, 2020, 5:41am UTC](https://discourse.julialang.org/t/is-it-possible-perform-reverse-mode-differentiation-flux-jl-with-zygote-jl-of-a-forward-mode-differentiation-result-e-g-forwarddiff/30945 "2020-03-10T05:41:45Z")

</div>

Say I have some function f: \\mathbb{R}^m \\times \\mathbb{R} \\to \\mathbb{R}^n, i.e. f(\\theta, x) is some vector for a given set of parameters \\theta and a scalar x. I would now like to calculate the gradient \\nabla\_\\theta …

---

## [Density-based clustering with incomplete distance matrix](https://discourse.julialang.org/t/density-based-clustering-with-incomplete-distance-matrix/35675)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 0\
**Last updated:** [March 7, 2020, 4:12am UTC](https://discourse.julialang.org/t/density-based-clustering-with-incomplete-distance-matrix/35675 "2020-03-07T04:12:26Z")

</div>

I am looking for a clustering algorithm (probably density based) that works with custom distances (I have my own non-Euclidean distance metric) and can work on very large datasets. I can evaluate nearest neighbors quickl…

---

## [FLUX + Pytorch + tensorflow](https://discourse.julialang.org/t/flux-pytorch-tensorflow/35584)

<div class="topic-metadata">

**Author:** [@JP\_Nieto](https://discourse.julialang.org/u/JP_Nieto)\
**Replies:** 0\
**Last updated:** [March 5, 2020, 3:13pm UTC](https://discourse.julialang.org/t/flux-pytorch-tensorflow/35584 "2020-03-05T15:13:20Z")

</div>

Is it possible to integrate layers of pytorch and tensorflow in Flux models? any example?

---

## ["The applicable method may be too new" - Inference by loading saved BSON Flux model](https://discourse.julialang.org/t/the-applicable-method-may-be-too-new-inference-by-loading-saved-bson-flux-model/33913)

<div class="topic-metadata">

**Author:** [@jchen975](https://discourse.julialang.org/u/jchen975)\
**Replies:** 1\
**Last updated:** [March 4, 2020, 11:47am UTC](https://discourse.julialang.org/t/the-applicable-method-may-be-too-new-inference-by-loading-saved-bson-flux-model/33913 "2020-03-04T11:47:37Z")

</div>

Hi, I was trying to do inference with a previously trained Flux CNN that was saved with BSON with the following: 38 @load model\_name model 39 model = model |\> gpu 40 data = data |\> gpu 41 42 println(type…

---

## [Interest in a port of snorkel?](https://discourse.julialang.org/t/interest-in-a-port-of-snorkel/35349)

<div class="topic-metadata">

**Author:** [@a5vzener](https://discourse.julialang.org/u/a5vzener)\
**Replies:** 0\
**Last updated:** [March 1, 2020, 4:52am UTC](https://discourse.julialang.org/t/interest-in-a-port-of-snorkel/35349 "2020-03-01T04:52:27Z")

</div>

Has anyone used snorkel, a python package for efficient data set labeling? Does this seem like a good algorithm or system to be ported to Julia? -doug

---

## [Code to train a Support Vector Machine?](https://discourse.julialang.org/t/code-to-train-a-support-vector-machine/35300)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [February 28, 2020, 8:39pm UTC](https://discourse.julialang.org/t/code-to-train-a-support-vector-machine/35300 "2020-02-28T20:39:15Z")

</div>

Hello, In the MITx 6.86x “Machine Learning with Python-From Linear Models to Deep Learning” course we has been presented with a recitation that uses scikit-learn to train a SVM model (code follows). In particular, the …

---

## [Why zip the data argument to the \`Flux::train!\` function?](https://discourse.julialang.org/t/why-zip-the-data-argument-to-the-flux-train-function/35024)

<div class="topic-metadata">

**Author:** [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)\
**Replies:** 6\
**Last updated:** [February 25, 2020, 5:10am UTC](https://discourse.julialang.org/t/why-zip-the-data-argument-to-the-flux-train-function/35024 "2020-02-25T05:10:44Z")

</div>

I have been playing with the model zoo autoencoder code. I have a question about this line of code: @epochs 10 Flux.train!(loss, params(m), zip(data), opt, cb = evalcb) (permalink) What is zip(data) doing to the data,…

---

## [Best way to implement shortcut connections for feed-forward neural networks in Flux.jl](https://discourse.julialang.org/t/best-way-to-implement-shortcut-connections-for-feed-forward-neural-networks-in-flux-jl/10633)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 10\
**Last updated:** [February 21, 2020, 3:19pm UTC](https://discourse.julialang.org/t/best-way-to-implement-shortcut-connections-for-feed-forward-neural-networks-in-flux-jl/10633 "2020-02-21T15:19:32Z")

</div>

Using Flux.jl, I would like to build Feed-Forward Neural Network, but with shortcut connections like those found in ResNet. What would be the best way to do this? I know that something like Chain(Dense(10, 5, relu), Den…

---

## [Flux failing on GPU](https://discourse.julialang.org/t/flux-failing-on-gpu/18948)

<div class="topic-metadata">

**Author:** [@jcreinhold](https://discourse.julialang.org/u/jcreinhold)\
**Replies:** 25\
**Last updated:** [February 21, 2020, 8:00am UTC](https://discourse.julialang.org/t/flux-failing-on-gpu/18948 "2020-02-21T08:00:01Z")

</div>

Hello all, I’ve been trying to get up and running with Flux to create some DNNs in Julia, but I’ve been running into some issues with getting CUDA working with Flux. I have some preliminary work in this notebook. I tri…

---

## [BayesNets Structure Learning Exception](https://discourse.julialang.org/t/bayesnets-structure-learning-exception/34849)

<div class="topic-metadata">

**Author:** [@rsteckel](https://discourse.julialang.org/u/rsteckel)\
**Replies:** 3\
**Last updated:** [February 20, 2020, 5:43pm UTC](https://discourse.julialang.org/t/bayesnets-structure-learning-exception/34849 "2020-02-20T17:43:27Z")

</div>

I’ve been trying out the BayesNets.jl package. I would like to learn the structure of a bayesian network using a small number of Bool variables in a DataFrame. First, I set the parameters of the search data = CSV.read(…

---

## [Allocations in Zygote for a simple derivative](https://discourse.julialang.org/t/allocations-in-zygote-for-a-simple-derivative/34871)

<div class="topic-metadata">

**Author:** [@edwinb-ai](https://discourse.julialang.org/u/edwinb-ai)\
**Replies:** 0\
**Last updated:** [February 19, 2020, 5:41pm UTC](https://discourse.julialang.org/t/allocations-in-zygote-for-a-simple-derivative/34871 "2020-02-19T17:41:57Z")

</div>

Hello everyone, somewhat new to Julia and very new to Zygote. I want to use Zygote’s AD functionality to compute derivatives of some simple functions, like in the following code using Zygote using Random using Benchmark…

---

## [Is it possible to use batching in Flux for sequences of different lengths?](https://discourse.julialang.org/t/is-it-possible-to-use-batching-in-flux-for-sequences-of-different-lengths/34594)

<div class="topic-metadata">

**Author:** [@jmeeks29ig](https://discourse.julialang.org/u/jmeeks29ig)\
**Replies:** 3\
**Last updated:** [February 19, 2020, 12:32am UTC](https://discourse.julialang.org/t/is-it-possible-to-use-batching-in-flux-for-sequences-of-different-lengths/34594 "2020-02-19T00:32:56Z")

</div>

I have sequences that are of the dimensions 8 by N, where N is a number fluctuating between 1 and 400. I would like to be able to do batch processing on these sequences, but have not had any luck in doing so inside of Fl…

---

## [I managed to make Flux.jl work with GPUs again!](https://discourse.julialang.org/t/i-managed-to-make-flux-jl-work-with-gpus-again/19386)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 6\
**Last updated:** [February 18, 2020, 2:14pm UTC](https://discourse.julialang.org/t/i-managed-to-make-flux-jl-work-with-gpus-again/19386 "2020-02-18T14:14:21Z")

</div>

If you look at the model zoo for mnist mlp for Flux.jl you may notice the line using CuArrays is commented out. Presumably, this was because the rest of the code would fail if that line was turned on. Of course, CuArrays…

---

## [Automate training MLJ models](https://discourse.julialang.org/t/automate-training-mlj-models/32284)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 14\
**Last updated:** [February 17, 2020, 2:44am UTC](https://discourse.julialang.org/t/automate-training-mlj-models/32284 "2020-02-17T02:44:54Z")

</div>

I’d like to train 3 models in MLJ: ARDRegressor, AdaBoostRegressor, BaggingRegressor Currently, I train them 1 at a time for example: using Pkg; Pkg.activate("."); Pkg.instantiate(); using RDatasets, MLJ, Statistics, P…

---

## [For Knet.jl connoisseurs : problem with WTYPE error](https://discourse.julialang.org/t/for-knet-jl-connoisseurs-problem-with-wtype-error/34523)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 0\
**Last updated:** [February 12, 2020, 3:46pm UTC](https://discourse.julialang.org/t/for-knet-jl-connoisseurs-problem-with-wtype-error/34523 "2020-02-12T15:46:19Z")

</div>

I am trying to build a RNN with self-attention mechanism using knet (maybe I should have sticked to python …) and after fixing all sorts of puzzling error I am faced with the following one : AssertionError: r.c == nothi…

---

## [How can I optimize recurrent networks in Flux?](https://discourse.julialang.org/t/how-can-i-optimize-recurrent-networks-in-flux/34425)

<div class="topic-metadata">

**Author:** [@jmeeks29ig](https://discourse.julialang.org/u/jmeeks29ig)\
**Replies:** 0\
**Last updated:** [February 10, 2020, 5:15pm UTC](https://discourse.julialang.org/t/how-can-i-optimize-recurrent-networks-in-flux/34425 "2020-02-10T17:15:45Z")

</div>

Hi, I posted a question in stackoverflow (optimization - How can I optimize a recurrent network in Julia with Flux? - Stack Overflow) regarding the performance of Flux in using a recurrent neural network. I have been ge…

---

## [Training dataset and reporting MSE](https://discourse.julialang.org/t/training-dataset-and-reporting-mse/34391)

<div class="topic-metadata">

**Author:** [@Praise](https://discourse.julialang.org/u/Praise)\
**Replies:** 6\
**Last updated:** [February 10, 2020, 2:49pm UTC](https://discourse.julialang.org/t/training-dataset-and-reporting-mse/34391 "2020-02-10T14:49:16Z")

</div>

Hello, I am trying to train dataset using linear regression in julia and then I have to calculate the MSE of the given test dataset. I was wondering what are the best packages to use, and an example of how to do this wit…

---

## [Julia Flux Right Version](https://discourse.julialang.org/t/julia-flux-right-version/34303)

<div class="topic-metadata">

**Author:** [@Owolf](https://discourse.julialang.org/u/Owolf)\
**Replies:** 3\
**Last updated:** [February 10, 2020, 11:10am UTC](https://discourse.julialang.org/t/julia-flux-right-version/34303 "2020-02-10T11:10:12Z")

</div>

Hello Everybody, I am new in Julia and Flux. I went through model-zoo and it seems as pretty nice example. However as far I had no luck to make it work. After hours of googling and going through non-consistent informati…

---

## [In Zygote, why (model)-\>... in gradient](https://discourse.julialang.org/t/in-zygote-why-model-in-gradient/34367)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 4\
**Last updated:** [February 10, 2020, 6:16am UTC](https://discourse.julialang.org/t/in-zygote-why-model-in-gradient/34367 "2020-02-10T06:16:23Z")

</div>

In this (helpful!) post, https://kiranshila.com/index.php/2020/02/04/teaching-myself-machine-learning-with-julia-part-1/ The (zygote) gradient call is g = gradient(model -\> mse(model.(x),y), model) I tried instead…

---

## [Innocent looking optimization of the forward pass causes performance cliff in gradient calculation with Zygote.jl v0.4.7](https://discourse.julialang.org/t/innocent-looking-optimization-of-the-forward-pass-causes-performance-cliff-in-gradient-calculation-with-zygote-jl-v0-4-7/34188)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 5\
**Last updated:** [February 5, 2020, 3:50pm UTC](https://discourse.julialang.org/t/innocent-looking-optimization-of-the-forward-pass-causes-performance-cliff-in-gradient-calculation-with-zygote-jl-v0-4-7/34188 "2020-02-05T15:50:17Z")

</div>

Consider the following code example: using LinearAlgebra using Flux using BenchmarkTools function diagmatmul(m, xs) ys = m.(xs) zs = diag.((first(ys)',) .\* ys) return sum(sum(zs)) end function colwise(m, x…

---

## [How can I train a simple model to understand the relation of math addition? \[Flux\]](https://discourse.julialang.org/t/how-can-i-train-a-simple-model-to-understand-the-relation-of-math-addition-flux/34294)

<div class="topic-metadata">

**Author:** [@TheOnlyArtz](https://discourse.julialang.org/u/TheOnlyArtz)\
**Replies:** 5\
**Last updated:** [February 7, 2020, 2:07pm UTC](https://discourse.julialang.org/t/how-can-i-train-a-simple-model-to-understand-the-relation-of-math-addition-flux/34294 "2020-02-07T14:07:27Z")

</div>

So as the title suggests, I want to get started with Flux and I can’t really understand that much from the docs, I want to train a simple model which will take 2 numbers in the input layer and output a single number (the…

---

## [AlexNet import to Julia](https://discourse.julialang.org/t/alexnet-import-to-julia/34209)

<div class="topic-metadata">

**Author:** [@samantp](https://discourse.julialang.org/u/samantp)\
**Replies:** 1\
**Last updated:** [February 5, 2020, 4:13pm UTC](https://discourse.julialang.org/t/alexnet-import-to-julia/34209 "2020-02-05T16:13:46Z")

</div>

I am trying to download and modify AlexNet, the well known pre-trained neural network into Julia. Are there any packages that have already done this or have well known pre-trained NN’s that are open to modification? I a…

---

## [\[ANN\] Flux v0.10](https://discourse.julialang.org/t/ann-flux-v0-10/31660)

<div class="topic-metadata">

**Author:** [@dhairyagandhi96](https://discourse.julialang.org/u/dhairyagandhi96)\
**Replies:** 36\
**Last updated:** [February 4, 2020, 7:57pm UTC](https://discourse.julialang.org/t/ann-flux-v0-10/31660 "2020-02-04T19:57:14Z")

</div>

We are delighted to announce the release of Flux v0.10. This is a huge release including the work of many contributors; the major development is that Flux now uses Zygote as its default backend for gradients, removing m…

---

## [Zygote: treating a model output as a constant](https://discourse.julialang.org/t/zygote-treating-a-model-output-as-a-constant/34172)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [February 4, 2020, 5:18pm UTC](https://discourse.julialang.org/t/zygote-treating-a-model-output-as-a-constant/34172 "2020-02-04T17:18:46Z")

</div>

Say I have a model m = Dense(1,1), a function f(x) = x, and a loss(a,b,c) = m(a) - b - f(c). I don’t want zygote to differentiate on f(c) when calling gradient(() -\> loss(a,b,c), m) . How do I tell it that ? It is a pro…

---

## [Implement berHu loss in Flux](https://discourse.julialang.org/t/implement-berhu-loss-in-flux/31707)

<div class="topic-metadata">

**Author:** [@jchen975](https://discourse.julialang.org/u/jchen975)\
**Replies:** 9\
**Last updated:** [February 1, 2020, 9:06pm UTC](https://discourse.julialang.org/t/implement-berhu-loss-in-flux/31707 "2020-02-01T21:06:06Z")

</div>

Hi, I was trying to build this loss function from this paper: I wanted to see if it outperforms squared L2 norm in another regression problem I’m working on. Here is my attempt: function berhu(x, y) x = model…

---

## [Help with gradient](https://discourse.julialang.org/t/help-with-gradient/33943)

<div class="topic-metadata">

**Author:** [@ccc1685](https://discourse.julialang.org/u/ccc1685)\
**Replies:** 6\
**Last updated:** [January 31, 2020, 1:31pm UTC](https://discourse.julialang.org/t/help-with-gradient/33943 "2020-01-31T13:31:10Z")

</div>

Hi, I have a loss function that involves a probability density that requires several matrix operations to derive. When I tried running gradient on it through either Flux or Zygote I get this error: Mutating arrays is n…

---

## [Way to train model in Julia and deploy in Javascript?](https://discourse.julialang.org/t/way-to-train-model-in-julia-and-deploy-in-javascript/34002)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 0\
**Last updated:** [January 30, 2020, 11:53pm UTC](https://discourse.julialang.org/t/way-to-train-model-in-julia-and-deploy-in-javascript/34002 "2020-01-30T23:53:43Z")

</div>

I recently built an Airbnb price prediction tool in Javascript. However I had to do a lot of my initial work and EDA in Python using Scikit-learn. This seemed like a two language problem, so was wondering if anyone had …

---

## [Importing Pre-Trained Model in Julia](https://discourse.julialang.org/t/importing-pre-trained-model-in-julia/33952)

<div class="topic-metadata">

**Author:** [@abianco](https://discourse.julialang.org/u/abianco)\
**Replies:** 2\
**Last updated:** [January 30, 2020, 12:05pm UTC](https://discourse.julialang.org/t/importing-pre-trained-model-in-julia/33952 "2020-01-30T12:05:14Z")

</div>

Is there an effective way to import a pre-trained model (or at least the model specification and weights) in Julia and use it in TensorFlow.jl? If not, are there other ways to load in a pre-trained BLSTM and work with i…

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

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