# Machine Learning

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

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

**Page:** 44

---

## [Sigmoid function](https://discourse.julialang.org/t/sigmoid-function/40614)

<div class="topic-metadata">

**Author:** [@Shirin](https://discourse.julialang.org/u/Shirin)\
**Replies:** 8\
**Last updated:** [June 2, 2020, 6:25pm UTC](https://discourse.julialang.org/t/sigmoid-function/40614 "2020-06-02T18:25:18Z")

</div>

Hello, I have difficulty with getting the derivate (Gradient ) of sigmoid! using Flux sigmoid(x)=1 ./(1 .+exp(.-x)) sigmoid(x)=s d(s)=x .\* (1 .- x) d(\[1 2 3\]) it causes error or not outputting correct number! I w…

---

## [Sample rate conversion from audio files](https://discourse.julialang.org/t/sample-rate-conversion-from-audio-files/40578)

<div class="topic-metadata">

**Author:** [@bafonso](https://discourse.julialang.org/u/bafonso)\
**Replies:** 3\
**Last updated:** [June 2, 2020, 7:25am UTC](https://discourse.julialang.org/t/sample-rate-conversion-from-audio-files/40578 "2020-06-02T07:25:04Z")

</div>

What is the easiest way to load and convert audio files? I’d rather do it on the fly instead of loading and saving as a batch. Right now I am loading files with load or loadstreaming but I need to have a uniform sampling…

---

## [Solve a SDE using Neural network](https://discourse.julialang.org/t/solve-a-sde-using-neural-network/40177)

<div class="topic-metadata">

**Author:** [@shoudao](https://discourse.julialang.org/u/shoudao)\
**Replies:** 11\
**Last updated:** [May 31, 2020, 3:30pm UTC](https://discourse.julialang.org/t/solve-a-sde-using-neural-network/40177 "2020-05-31T15:30:32Z")

</div>

I am trying to solve SDE using Neural networks recently. I have an idea to solve a SDE in this form: d X\_{t}=f\\left(X\_{t}, t,r,\\mu\_t \\right) d t+g\\left(X\_{t}, t,r,\\mu\_t \\right) d W\_{t} But I am not sure how to impleme…

---

## [3D array reshape error](https://discourse.julialang.org/t/3d-array-reshape-error/40507)

<div class="topic-metadata">

**Author:** [@dialektike](https://discourse.julialang.org/u/dialektike)\
**Replies:** 2\
**Last updated:** [May 31, 2020, 2:22pm UTC](https://discourse.julialang.org/t/3d-array-reshape-error/40507 "2020-05-31T14:22:20Z")

</div>

A = np.array(range(1, 9)).reshape(2, 2, 2) # swap 2nd and 3rd axes: A.transpose((0, 2, 1)) I’m also trying to julia like the above python code. trying like this… A = reshape(1:8, 2, 2, 2) # swap 2nd and 3rd axes: re…

---

## [Wher to find toy examples (with data) to check my (toy as well) implementation of ML algorithms?](https://discourse.julialang.org/t/wher-to-find-toy-examples-with-data-to-check-my-toy-as-well-implementation-of-ml-algorithms/40188)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [May 27, 2020, 11:45am UTC](https://discourse.julialang.org/t/wher-to-find-toy-examples-with-data-to-check-my-toy-as-well-implementation-of-ml-algorithms/40188 "2020-05-27T11:45:06Z")

</div>

I am developing a toy ML package, but I would like to test it with some simple datasets and implementation in established packages… is there a repository with simple data/algorithm (not necessarily in Julia) to see how m…

---

## [Hidden layers in Flux](https://discourse.julialang.org/t/hidden-layers-in-flux/39910)

<div class="topic-metadata">

**Author:** [@Mariana](https://discourse.julialang.org/u/Mariana)\
**Replies:** 5\
**Last updated:** [May 22, 2020, 1:24pm UTC](https://discourse.julialang.org/t/hidden-layers-in-flux/39910 "2020-05-22T13:24:13Z")

</div>

I’m starting to work with Flux and I want to build a neural network with 5 entries and 6 exits. I have already built a network with no hidden layers, but now I want to add hidden layers. How should I do that? I believe I…

---

## [MLJ: Evaluating a probabilistic metric and a deterministic metric at the same time](https://discourse.julialang.org/t/mlj-evaluating-a-probabilistic-metric-and-a-deterministic-metric-at-the-same-time/39775)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [May 20, 2020, 9:45pm UTC](https://discourse.julialang.org/t/mlj-evaluating-a-probabilistic-metric-and-a-deterministic-metric-at-the-same-time/39775 "2020-05-20T21:45:00Z")

</div>

The evaluate and evaluate! methods in MLJ can accept a vector of metric functions. However, it doesn’t appear that you can evaluate metrics based on probabilistic predictions (e.g. AUC) and metrics based on deterministic…

---

## [Julia method error](https://discourse.julialang.org/t/julia-method-error/39644)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 6\
**Last updated:** [May 18, 2020, 10:36am UTC](https://discourse.julialang.org/t/julia-method-error/39644 "2020-05-18T10:36:40Z")

</div>

I created a neural network using Flux library. My code is based on the paper “neural importance sampling”. I defined custom layers and custom loss function. Each layer returns two outputs. When I run my code, I receive t…

---

## [Alternativa to softmax?](https://discourse.julialang.org/t/alternativa-to-softmax/39671)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 1\
**Last updated:** [May 18, 2020, 2:55am UTC](https://discourse.julialang.org/t/alternativa-to-softmax/39671 "2020-05-18T02:55:51Z")

</div>

alternativa to softmax? Would you suggest it? I don’t like softmax since softmax(const \* x) != softmax (x) . For instance softmax(\[0,0.2,0.05\]) = \[0.3,0.37,0.32\], so I can’t interpretare it as probability at all, bacu…

---

## [This is how to call finite difference gradcheck on a model](https://discourse.julialang.org/t/this-is-how-to-call-finite-difference-gradcheck-on-a-model/39607)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 0\
**Last updated:** [May 17, 2020, 12:05am UTC](https://discourse.julialang.org/t/this-is-how-to-call-finite-difference-gradcheck-on-a-model/39607 "2020-05-17T00:05:16Z")

</div>

I learned of the undocumented gradcheck function in a recent question, but it was not clear how to apply it to a model (rather than an array). It requires the use of Flux.destructure., as mentioned in the recent pull req…

---

## [NN: how to choose the layers/neurons?](https://discourse.julialang.org/t/nn-how-to-choose-the-layers-neurons/39530)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [May 15, 2020, 3:45pm UTC](https://discourse.julialang.org/t/nn-how-to-choose-the-layers-neurons/39530 "2020-05-15T15:45:00Z")

</div>

I am implementing my own NN “library”, but I am stuck on which is the best way to then implement the network itself, i.e. which type of layers to use, how many and how many neurons. Let’s consider for example the follow…

---

## [Flux: Scalar getindex error](https://discourse.julialang.org/t/flux-scalar-getindex-error/39451)

<div class="topic-metadata">

**Author:** [@Ching\_Lam\_Choi](https://discourse.julialang.org/u/Ching_Lam_Choi)\
**Replies:** 13\
**Last updated:** [May 15, 2020, 2:17pm UTC](https://discourse.julialang.org/t/flux-scalar-getindex-error/39451 "2020-05-15T14:17:22Z")

</div>

I am trying to do optimisation using Flux’s logitbinarycrossentropy function on a fully-convolutional network on GPU: Flux.train!(loss, params(UNet\_model), train\_batch, optimiser) Where loss is defined as: loss(x, y) …

---

## [Flux convolutional layer not type stable](https://discourse.julialang.org/t/flux-convolutional-layer-not-type-stable/39454)

<div class="topic-metadata">

**Author:** [@LeoKoo](https://discourse.julialang.org/u/LeoKoo)\
**Replies:** 0\
**Last updated:** [May 14, 2020, 9:55am UTC](https://discourse.julialang.org/t/flux-convolutional-layer-not-type-stable/39454 "2020-05-14T09:55:18Z")

</div>

In my spare time I am trying to implement YOLOv3 using Flux. I believe I’ve successfully defined the model, leaving me to find a way to translate the YOLOv3 pretrained weights into Flux. However, I have noticed, using ra…

---

## [Yolo darknet](https://discourse.julialang.org/t/yolo-darknet/21454)

<div class="topic-metadata">

**Author:** [@yash](https://discourse.julialang.org/u/yash)\
**Replies:** 6\
**Last updated:** [March 10, 2019, 12:24am UTC](https://discourse.julialang.org/t/yolo-darknet/21454 "2019-03-10T00:24:55Z")

</div>

YOLO stands for “You only look once” is currently is state-of-the-art for real time object recognition. As compared other algorithm like R CNN , mask RCNN and other Computer vision methods it is very fast to detect mult…

---

## ["gradcheck" in Flux?](https://discourse.julialang.org/t/gradcheck-in-flux/39158)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 5:53am UTC](https://discourse.julialang.org/t/gradcheck-in-flux/39158 "2020-05-11T05:53:19Z")

</div>

Is there a function to check the Zygote gradient against a finite-difference? I think I had seen something in discussions here but cannot find it, also not in the docs

---

## [Flux Activations() computes the forward pass again](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 5:50am UTC](https://discourse.julialang.org/t/flux-activations-computes-the-forward-pass-again/38904 "2020-05-11T05:50:43Z")

</div>

It looks like the activations() function (in basic.jl) computes the forward pass to obtain the activations, which would mean that it is computed twice. I guess a fix for this would be to implement a custom alternative …

---

## [A implementation of ResNet-18 uses lot of GPU memory](https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389)

<div class="topic-metadata">

**Author:** [@OTapio](https://discourse.julialang.org/u/OTapio)\
**Replies:** 10\
**Last updated:** [May 9, 2020, 5:50am UTC](https://discourse.julialang.org/t/a-implementation-of-resnet-18-uses-lot-of-gpu-memory/36389 "2020-05-09T05:50:22Z")

</div>

I have been trying to create ResNet-18 on Julia. I have managed to create a functional one but it is slow and uses lot of GPU memory. This is puzzling since similar architecture on Tensorflow runs 5-10 times faster and u…

---

## [Implementing a custom layer](https://discourse.julialang.org/t/implementing-a-custom-layer/38632)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [May 6, 2020, 5:40pm UTC](https://discourse.julialang.org/t/implementing-a-custom-layer/38632 "2020-05-06T17:40:45Z")

</div>

I am hoping to implement a custom “layer” soon. I think the requirements for this are a) it accepts input from previous layer, and produces outputs, b) Flux.params() can find its parameters, c) gpu() can find its pa…

---

## [New machine learning package, Julia implementation of XGBoost ](https://discourse.julialang.org/t/new-machine-learning-package-julia-implementation-of-xgboost/8912)

<div class="topic-metadata">

**Author:** [@statfactory](https://discourse.julialang.org/u/statfactory)\
**Replies:** 32\
**Last updated:** [March 10, 2020, 6:47am UTC](https://discourse.julialang.org/t/new-machine-learning-package-julia-implementation-of-xgboost/8912 "2020-03-10T06:47:49Z")

</div>

Hi, I am working on a new Julia machine learning package. What I have now is a pure Julia implementation of XGBoost in \< 500 lines of code: https://github.com/Statfactory/JuML.jl It seems to be as fast as original XGB…

---

## [Regression in Flux.jl](https://discourse.julialang.org/t/regression-in-flux-jl/38733)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 5\
**Last updated:** [May 4, 2020, 5:09pm UTC](https://discourse.julialang.org/t/regression-in-flux-jl/38733 "2020-05-04T17:09:44Z")

</div>

Trying to get started with Flux.jl. I’m trying estimate a linear regression. I have the following: using Flux using Random Random.seed!(1234) β = \[10., 20., 30.\] # true parameters predict(x) = (x\*β) function loss(x,…

---

## [How do you deserialize stateful optimizers in Flux?](https://discourse.julialang.org/t/how-do-you-deserialize-stateful-optimizers-in-flux/38644)

<div class="topic-metadata">

**Author:** [@findmyway](https://discourse.julialang.org/u/findmyway)\
**Replies:** 4\
**Last updated:** [May 3, 2020, 7:47am UTC](https://discourse.julialang.org/t/how-do-you-deserialize-stateful-optimizers-in-flux/38644 "2020-05-03T07:47:39Z")

</div>

For some stateful optimizers, like ADAM, it has an IdDict field to store momentums of parameters. When deserializing the optimizer with BSON, the id info is lost in the newly created IdDict. This makes it hard to truly r…

---

## [Zygote error. "Only reference types can be differentiated with \`Params\`."](https://discourse.julialang.org/t/zygote-error-only-reference-types-can-be-differentiated-with-params/38224)

<div class="topic-metadata">

**Author:** [@Emmanuel-R8](https://discourse.julialang.org/u/Emmanuel-R8)\
**Replies:** 8\
**Last updated:** [May 2, 2020, 11:01pm UTC](https://discourse.julialang.org/t/zygote-error-only-reference-types-can-be-differentiated-with-params/38224 "2020-05-02T23:01:47Z")

</div>

I have been updating the Lotka-Volterra example in the model zoo. The call to train! fails with an error in Zygote src/compiler/interface.jl line 129 with the error in the title. The reason for the error is a mystery to…

---

## [Assigning to an array that is on the GPU](https://discourse.julialang.org/t/assigning-to-an-array-that-is-on-the-gpu/38498)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [May 2, 2020, 10:30pm UTC](https://discourse.julialang.org/t/assigning-to-an-array-that-is-on-the-gpu/38498 "2020-05-02T22:30:42Z")

</div>

Suppose an array is on the gpu. In assigning new values to it, should we put the right hand side of the assignment on the gpu first before doing the assignment. I.e., A = cu(rand(5,1)) B = zeros(5,1) is this ok …

---

## [Matrix profile calculation: STOMP method](https://discourse.julialang.org/t/matrix-profile-calculation-stomp-method/25389)

<div class="topic-metadata">

**Author:** [@taqtiqa-mark](https://discourse.julialang.org/u/taqtiqa-mark)\
**Replies:** 1\
**Last updated:** [May 1, 2020, 4:13am UTC](https://discourse.julialang.org/t/matrix-profile-calculation-stomp-method/25389 "2020-05-01T04:13:37Z")

</div>

Hi, Is there a Julia package that implements the matrix profile calculation using the STOMP method, i.e. corresponds to Stumpy’s … scalable library that efficiently computes something called the matrix profile Alter…

---

## [Flux vs Keras time series prediction performance](https://discourse.julialang.org/t/flux-vs-keras-time-series-prediction-performance/38421)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 3\
**Last updated:** [April 30, 2020, 7:45am UTC](https://discourse.julialang.org/t/flux-vs-keras-time-series-prediction-performance/38421 "2020-04-30T07:45:45Z")

</div>

Hi, I compare the prediction quality of two neural networks on a time series. One trained by Keras and one trained by Flux. Unfortunately I´m not able to achieve the same quality (see figure) and I don´t know why. I…

---

## [Status of Flux model zoo](https://discourse.julialang.org/t/status-of-flux-model-zoo/38130)

<div class="topic-metadata">

**Author:** [@Emmanuel-R8](https://discourse.julialang.org/u/Emmanuel-R8)\
**Replies:** 6\
**Last updated:** [April 30, 2020, 6:39am UTC](https://discourse.julialang.org/t/status-of-flux-model-zoo/38130 "2020-04-30T06:39:03Z")

</div>

I was interested in updating Flux’s model zoo since everything I tried is out of date. But I saw that there are a lot of pull requests which are outstanding. Is it still maintained? Did I miss an announcement on that? …

---

## [What is "splatting" in flux (loss?)?](https://discourse.julialang.org/t/what-is-splatting-in-flux-loss/37548)

<div class="topic-metadata">

**Author:** [@jaynick](https://discourse.julialang.org/u/jaynick)\
**Replies:** 2\
**Last updated:** [April 29, 2020, 8:34pm UTC](https://discourse.julialang.org/t/what-is-splatting-in-flux-loss/37548 "2020-04-29T20:34:04Z")

</div>

In the Flux docs for train! it says In case datapoints d are of numeric array type, assume no splatting is needed and compute the gradient of loss(d) . What does “splatting” mean here? I am guessing that what this m…

---

## [Thoughts on Jax vs CuArrays and Zygote](https://discourse.julialang.org/t/thoughts-on-jax-vs-cuarrays-and-zygote/19915)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 10\
**Last updated:** [April 28, 2020, 3:00pm UTC](https://discourse.julialang.org/t/thoughts-on-jax-vs-cuarrays-and-zygote/19915 "2020-04-28T15:00:31Z")

</div>

Google’s JAX looks like a combination of CuArrays and Zygote for Python. I wonder if anyone can compare and contrast Jax with CuArrays and Zygote? I can’t gather how Jax is different apart from the fact that it compiles…

---

## [Zygote: mutating array error with Buffer during parameter gradient call](https://discourse.julialang.org/t/zygote-mutating-array-error-with-buffer-during-parameter-gradient-call/38269)

<div class="topic-metadata">

**Author:** [@ahl](https://discourse.julialang.org/u/ahl)\
**Replies:** 0\
**Last updated:** [April 27, 2020, 12:51am UTC](https://discourse.julialang.org/t/zygote-mutating-array-error-with-buffer-during-parameter-gradient-call/38269 "2020-04-27T00:51:42Z")

</div>

I’m trying to update the parameters of a multi-input multi-output neural network using a loss function that is some function of the Jacobian of the neural network. However, computing the gradient of the loss produces an …

---

## [How to import a pre-trained neural network into Flux.jl ?](https://discourse.julialang.org/t/how-to-import-a-pre-trained-neural-network-into-flux-jl/9659)

<div class="topic-metadata">

**Author:** [@Nirvan101](https://discourse.julialang.org/u/Nirvan101)\
**Replies:** 7\
**Last updated:** [April 24, 2020, 10:42am UTC](https://discourse.julialang.org/t/how-to-import-a-pre-trained-neural-network-into-flux-jl/9659 "2020-04-24T10:42:37Z")

</div>

I’m using the Flux library in Julia. How can I import an Inception neural network into it? I’ve seen that the following can be done in Mocha.jl to import a pre-trained net. using HDF5 h5open("model/bvlc\_reference\_caff…

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

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