# Machine Learning

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

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

**Page:** 14

---

## [Avoiding closure in uODE with ComponentArrays causes minor numerical differences](https://discourse.julialang.org/t/avoiding-closure-in-uode-with-componentarrays-causes-minor-numerical-differences/102609)

<div class="topic-metadata">

**Author:** [@T\_J](https://discourse.julialang.org/u/T_J)\
**Replies:** 4\
**Last updated:** [August 9, 2023, 11:01am UTC](https://discourse.julialang.org/t/avoiding-closure-in-uode-with-componentarrays-causes-minor-numerical-differences/102609 "2023-08-09T11:01:56Z")

</div>

Hello, I would like to pass additional parameters to a uODE and avoid the closure relationship. Here is an example with the lotka-volterra system. # SciML Tools using OrdinaryDiffEq, ModelingToolkit, DataDrivenDiffEq,…

---

## [State of the art object tracking with neural networks](https://discourse.julialang.org/t/state-of-the-art-object-tracking-with-neural-networks/101710)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 3\
**Last updated:** [August 9, 2023, 7:04am UTC](https://discourse.julialang.org/t/state-of-the-art-object-tracking-with-neural-networks/101710 "2023-08-09T07:04:45Z")

</div>

Anyone following the latest models for object tracking in computer vision? Object tracking consists of identifying an object (or bounding box of the object) on every single frame of a video. It usually combines object d…

---

## [Neural Hybrid DE](https://discourse.julialang.org/t/neural-hybrid-de/102599)

<div class="topic-metadata">

**Author:** [@Mieszko](https://discourse.julialang.org/u/Mieszko)\
**Replies:** 2\
**Last updated:** [August 8, 2023, 6:14pm UTC](https://discourse.julialang.org/t/neural-hybrid-de/102599 "2023-08-08T18:14:17Z")

</div>

Hey, I am following this article Neural Hybrid Differential Equations | juliabloggers.com concerning Neural Hybrid DE. Currently, I am stuck at this moment with my code. using DiffEqFlux, DifferentialEquations, Flux, …

---

## [Discovery of mechanistic terms from UODE vs using the UODE](https://discourse.julialang.org/t/discovery-of-mechanistic-terms-from-uode-vs-using-the-uode/101940)

<div class="topic-metadata">

**Author:** [@gsh19](https://discourse.julialang.org/u/gsh19)\
**Replies:** 3\
**Last updated:** [August 8, 2023, 1:28pm UTC](https://discourse.julialang.org/t/discovery-of-mechanistic-terms-from-uode-vs-using-the-uode/101940 "2023-08-08T13:28:09Z")

</div>

Hi everyone, Going through the missing physics example, there is a section on symbolic regression via sparse regression. I understand that this has the advantage of more clearly exposing the relationship between the sys…

---

## [Getting gradients with loss using for-loop is slow in Flux.jl](https://discourse.julialang.org/t/getting-gradients-with-loss-using-for-loop-is-slow-in-flux-jl/102192)

<div class="topic-metadata">

**Author:** [@bb777](https://discourse.julialang.org/u/bb777)\
**Replies:** 4\
**Last updated:** [August 7, 2023, 2:40am UTC](https://discourse.julialang.org/t/getting-gradients-with-loss-using-for-loop-is-slow-in-flux-jl/102192 "2023-08-07T02:40:38Z")

</div>

Hello. I am trying to train an original model using Flux.jl for sequential data. I want to use a loss function that utilizes a for loop to recursively use the output of the neural network as input for each data point. H…

---

## [Lowest Possible Memory For Neural ODE](https://discourse.julialang.org/t/lowest-possible-memory-for-neural-ode/102526)

<div class="topic-metadata">

**Author:** [@prbzrg](https://discourse.julialang.org/u/prbzrg)\
**Replies:** 1\
**Last updated:** [August 6, 2023, 12:22am UTC](https://discourse.julialang.org/t/lowest-possible-memory-for-neural-ode/102526 "2023-08-06T00:22:42Z")

</div>

For a neural ode, what are the best kwargs to pass to the solve function that make it use the lowest possible memory in both direct and AD usage? I use: kwargs = Dict( :alg\_hints =\> \[:nonstiff, :memorybound\], :…

---

## [When calling PyTorch using PyCall or pythoncall, I run out of memory on GPU cards](https://discourse.julialang.org/t/when-calling-pytorch-using-pycall-or-pythoncall-i-run-out-of-memory-on-gpu-cards/102290)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 1\
**Last updated:** [July 31, 2023, 8:23am UTC](https://discourse.julialang.org/t/when-calling-pytorch-using-pycall-or-pythoncall-i-run-out-of-memory-on-gpu-cards/102290 "2023-07-31T08:23:48Z")

</div>

Hi All, I am inferfacing to PyTorch using PythonCall (or PyCall) with the data moved between Julia and Python by DLPack.jl. I use PyTorch to compute gradients and the rest (e.g. optimization) is handled by Julia, since …

---

## [Forcing inequallity in DAE](https://discourse.julialang.org/t/forcing-inequallity-in-dae/102205)

<div class="topic-metadata">

**Author:** [@tommy\_J](https://discourse.julialang.org/u/tommy_J)\
**Replies:** 1\
**Last updated:** [July 28, 2023, 10:32pm UTC](https://discourse.julialang.org/t/forcing-inequallity-in-dae/102205 "2023-07-28T22:32:34Z")

</div>

Hello everyone, I am trying to understand DAE example in here. I would like to ask the following: In the example, the constraint used is: 1 = y\_1 + y\_2 + y\_3. Is is also possible to enforce that y\_1, y\_2, y\_3 \\geq 0? …

---

## [Speed Comparison Python v Julia for custom layers](https://discourse.julialang.org/t/speed-comparison-python-v-julia-for-custom-layers/101922)

<div class="topic-metadata">

**Author:** [@willleeney](https://discourse.julialang.org/u/willleeney)\
**Replies:** 25\
**Last updated:** [July 28, 2023, 8:56am UTC](https://discourse.julialang.org/t/speed-comparison-python-v-julia-for-custom-layers/101922 "2023-07-28T08:56:36Z")

</div>

New to Julia and looking at comparisons of speed in forward pass with pytorch. I want to optimise performance of training a neural network that will contain custom layers. I have provide some code for an example. I want …

---

## [Distributing LLM over multiple GPUs](https://discourse.julialang.org/t/distributing-llm-over-multiple-gpus/101866)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 10\
**Last updated:** [July 26, 2023, 7:12pm UTC](https://discourse.julialang.org/t/distributing-llm-over-multiple-gpus/101866 "2023-07-26T19:12:53Z")

</div>

Hi all, I am experimenting with gradient optimization of prompts for large language models using an excellent Transformers.jl library. I know that most of the people would say that I should switch to PyTorch (or Jax) an…

---

## [Mix-mode training of large languages models in Julia](https://discourse.julialang.org/t/mix-mode-training-of-large-languages-models-in-julia/102090)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 7\
**Last updated:** [July 26, 2023, 6:47pm UTC](https://discourse.julialang.org/t/mix-mode-training-of-large-languages-models-in-julia/102090 "2023-07-26T18:47:00Z")

</div>

I am toying with Large Language models and amazing Transformers.jl. And although I am forced to call PyTorch because some models are not supported by Transformers.jl (falcon) and due to some external forces, I got intere…

---

## [Code works on CPU but not on GPU](https://discourse.julialang.org/t/code-works-on-cpu-but-not-on-gpu/102005)

<div class="topic-metadata">

**Author:** [@marcofrancis](https://discourse.julialang.org/u/marcofrancis)\
**Replies:** 6\
**Last updated:** [July 26, 2023, 4:20pm UTC](https://discourse.julialang.org/t/code-works-on-cpu-but-not-on-gpu/102005 "2023-07-26T16:20:06Z")

</div>

Hi, I’m trying to implement a PINN (physiscs informed neural network) to solve the heat equation in Julia. I come from pytorch and so my code probably doesn’t look very Julia-like. I managed to get a version of my code …

---

## [Radial basis function kernel](https://discourse.julialang.org/t/radial-basis-function-kernel/102046)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 2\
**Last updated:** [July 25, 2023, 7:43am UTC](https://discourse.julialang.org/t/radial-basis-function-kernel/102046 "2023-07-25T07:43:27Z")

</div>

Hello everyone, I am currently trying to code an MMD GAN (\[1705.08584\] MMD GAN: Towards Deeper Understanding of Moment Matching Network), but I would like to know if there is any package in Julia that directly implements…

---

## [Lasso and Ridge regularization](https://discourse.julialang.org/t/lasso-and-ridge-regularization/101851)

<div class="topic-metadata">

**Author:** [@T\_J](https://discourse.julialang.org/u/T_J)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 8:06pm UTC](https://discourse.julialang.org/t/lasso-and-ridge-regularization/101851 "2023-07-20T20:06:54Z")

</div>

Hello to all, How can I include Lasso and Ridge Regularization in SciML? I am using the Lotka-Volterra case as an example. Original loss function loss(θ) X̂ = predict(θ) mean(abs2, Xₙ .- X̂) end Is this corr…

---

## [Flux.@functor won't work on custom layer (empty parameters)](https://discourse.julialang.org/t/flux-functor-wont-work-on-custom-layer-empty-parameters/101587)

<div class="topic-metadata">

**Author:** [@Bizzi](https://discourse.julialang.org/u/Bizzi)\
**Replies:** 3\
**Last updated:** [July 19, 2023, 5:46am UTC](https://discourse.julialang.org/t/flux-functor-wont-work-on-custom-layer-empty-parameters/101587 "2023-07-19T05:46:35Z")

</div>

I’m having a hard time understanding the behavior of the @functor macro. See the snippets below: For the first one, I follow the tutorial on custom layers step by step and it works. For the second one, I alter the code s…

---

## [How to export a Flux model to Python?](https://discourse.julialang.org/t/how-to-export-a-flux-model-to-python/101750)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 2\
**Last updated:** [July 19, 2023, 5:17am UTC](https://discourse.julialang.org/t/how-to-export-a-flux-model-to-python/101750 "2023-07-19T05:17:23Z")

</div>

Hello! I have a trained models from Flux.jl which I would like to be able to use in Python. Is there a way to save these models in a format that would be easily readable by Pytorch or Tensorflow? Thanks!

---

## [How daggerflux works?](https://discourse.julialang.org/t/how-daggerflux-works/101687)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 1\
**Last updated:** [July 17, 2023, 6:28am UTC](https://discourse.julialang.org/t/how-daggerflux-works/101687 "2023-07-17T06:28:11Z")

</div>

Dear All, @dhairyagandhi96 Manytimes in past, I wanted to use GitHub - FluxML/DaggerFlux.jl: Distributed computation of differentiation pipelines to use multiple workers, devices, GPU, etc. since Julia wasn't fast enou…

---

## [Understanding few lines from NeuralPDE.jl PDE example (phi solution)](https://discourse.julialang.org/t/understanding-few-lines-from-neuralpde-jl-pde-example-phi-solution/101499)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 3\
**Last updated:** [July 16, 2023, 11:58pm UTC](https://discourse.julialang.org/t/understanding-few-lines-from-neuralpde-jl-pde-example-phi-solution/101499 "2023-07-16T23:58:24Z")

</div>

Hi all, first time I’m trying to use PINNs with Julia, as I’m reading the docs there are some parts that I’m missing. In this example : I see that the lines used for the predictions are: phi = discretization.phi u\_p…

---

## [Neural SDE example no method matching error](https://discourse.julialang.org/t/neural-sde-example-no-method-matching-error/101542)

<div class="topic-metadata">

**Author:** [@Mieszko](https://discourse.julialang.org/u/Mieszko)\
**Replies:** 2\
**Last updated:** [July 13, 2023, 10:53am UTC](https://discourse.julialang.org/t/neural-sde-example-no-method-matching-error/101542 "2023-07-13T10:53:22Z")

</div>

Hi, I was following this tutorial for NeuralSDEs: https://docs.juliahub.com/DiffEqFlux/BdO4p/1.10.3/examples/NN-SDE/. I tried to compile in Visual Studio and reached it until this moment: using Plots, Flux, DiffEqFlux…

---

## [Unexpected behaviour with Flux](https://discourse.julialang.org/t/unexpected-behaviour-with-flux/101527)

<div class="topic-metadata">

**Author:** [@gforchini](https://discourse.julialang.org/u/gforchini)\
**Replies:** 0\
**Last updated:** [July 12, 2023, 11:21am UTC](https://discourse.julialang.org/t/unexpected-behaviour-with-flux/101527 "2023-07-12T11:21:04Z")

</div>

I have notice a strange behaviour in Flux, and wonder if it is what should be expected or not. This is part of a WGAN. If D is defined by chaining Dense layers, everything works well. using Flux, Random, Statistics usi…

---

## [Terminology: "multi branch neural network" or what?](https://discourse.julialang.org/t/terminology-multi-branch-neural-network-or-what/101396)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [July 12, 2023, 8:56am UTC](https://discourse.julialang.org/t/terminology-multi-branch-neural-network-or-what/101396 "2023-07-12T08:56:40Z")

</div>

Hello, which is the correct name for a neural network architecture where multiple “branches” are learn, possibly but not necessarily togher, and each branch “ends” with an encoding representation of the relative features…

---

## [Choice of Kernel Function (MultiOutput Gaussian Process)](https://discourse.julialang.org/t/choice-of-kernel-function-multioutput-gaussian-process/101359)

<div class="topic-metadata">

**Author:** [@lsablon](https://discourse.julialang.org/u/lsablon)\
**Replies:** 0\
**Last updated:** [July 8, 2023, 6:55pm UTC](https://discourse.julialang.org/t/choice-of-kernel-function-multioutput-gaussian-process/101359 "2023-07-08T18:55:35Z")

</div>

Hi ! I am using Gaussian Processes in my research, but I lack some theoretical knowledge about multioutput kernels. For the moment, I am using the JuliaGaussianProcesses ecosystem. My training data are maps associated…

---

## [Running OOM trying to load data to GPU](https://discourse.julialang.org/t/running-oom-trying-to-load-data-to-gpu/100480)

<div class="topic-metadata">

**Author:** [@lepton01](https://discourse.julialang.org/u/lepton01)\
**Replies:** 2\
**Last updated:** [July 8, 2023, 6:26am UTC](https://discourse.julialang.org/t/running-oom-trying-to-load-data-to-gpu/100480 "2023-07-08T06:26:11Z")

</div>

Hello there. After training the CNN, I wrote a function to estimate the accuracy of it. function accuracy(A, B, name) BSON.@load name \* ".bson" model model = model |\> gpu X1, Y1 = A X2, Y2 = B Y\_tr\_…

---

## [Is there a way to parallelize portions of code in Flux?](https://discourse.julialang.org/t/is-there-a-way-to-parallelize-portions-of-code-in-flux/101096)

<div class="topic-metadata">

**Author:** [@josemanuel22](https://discourse.julialang.org/u/josemanuel22)\
**Replies:** 7\
**Last updated:** [July 6, 2023, 4:17pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-parallelize-portions-of-code-in-flux/101096 "2023-07-06T16:17:35Z")

</div>

Hello, I have a code where I want to execute a parallel loop within the code portion responsible for automatic differentiation. This is because the cost function I want to compute relies on certain properties of the esti…

---

## [Batch trainning with Lux and multiple optimizers](https://discourse.julialang.org/t/batch-trainning-with-lux-and-multiple-optimizers/100571)

<div class="topic-metadata">

**Author:** [@James\_Fernandez](https://discourse.julialang.org/u/James_Fernandez)\
**Replies:** 14\
**Last updated:** [July 6, 2023, 3:35pm UTC](https://discourse.julialang.org/t/batch-trainning-with-lux-and-multiple-optimizers/100571 "2023-07-06T15:35:40Z")

</div>

Hello to all, Following the description of batching in Flux in here. I have created a script with Lux: using Lux, Optimization, OptimizationOptimisers, OptimizationOptimJL, OrdinaryDiffEq, SciMLSensitivity, ComponentA…

---

## [Flux training gives NaNs](https://discourse.julialang.org/t/flux-training-gives-nans/34424)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 3\
**Last updated:** [July 3, 2023, 6:40pm UTC](https://discourse.julialang.org/t/flux-training-gives-nans/34424 "2023-07-03T18:40:51Z")

</div>

I’m training a CNN on a vision problem and sometimes the model parameters become NaNs. I don’t know how to create an MWE, and it doesn’t happen every time. The model itself is Chain( # input 96x96x1 Conv((5,5), 1=\>…

---

## [Differentiating Jacobian-vector product for sliced score matching?](https://discourse.julialang.org/t/differentiating-jacobian-vector-product-for-sliced-score-matching/99746)

<div class="topic-metadata">

**Author:** [@Red-Portal](https://discourse.julialang.org/u/Red-Portal)\
**Replies:** 18\
**Last updated:** [June 29, 2023, 5:56pm UTC](https://discourse.julialang.org/t/differentiating-jacobian-vector-product-for-sliced-score-matching/99746 "2023-06-29T17:56:47Z")

</div>

Hi, I’m trying to implement score matching in Julia. Essentially, one needs to differentiate through the expression: \\mathbb{E}\_{v \\sim \\mathcal{N}(0,\\mathbf{I})} \\mathbb{E}\_{x \\sim p(x)} \\left( v^{\\top} \\nabla\_x f(x; …

---

## [Take positive part of weights in loss function](https://discourse.julialang.org/t/take-positive-part-of-weights-in-loss-function/100950)

<div class="topic-metadata">

**Author:** [@clairem](https://discourse.julialang.org/u/clairem)\
**Replies:** 3\
**Last updated:** [June 29, 2023, 5:18pm UTC](https://discourse.julialang.org/t/take-positive-part-of-weights-in-loss-function/100950 "2023-06-29T17:18:07Z")

</div>

Hi! I’m trying to constrain my weights matrix to contain only positive values. I was confused by answers to similar questions, and I thought it might make sense to implement my loss function such that, when it takes my …

---

## [Request: call for NeurIPS ethics reviewers](https://discourse.julialang.org/t/request-call-for-neurips-ethics-reviewers/100984)

<div class="topic-metadata">

**Author:** [@jiahao](https://discourse.julialang.org/u/jiahao)\
**Replies:** 0\
**Last updated:** [June 29, 2023, 3:50pm UTC](https://discourse.julialang.org/t/request-call-for-neurips-ethics-reviewers/100984 "2023-06-29T15:50:35Z")

</div>

NeurIPS is seeking ethics reviewers, particularly in the areas of: a) Human rights and inappropriate potential applications, and b) Security and privacy. Call: NeurIPS 2023 Sign-up: NeurIPS 2023 Ethics Reviewer Invit…

---

## [Define geometry for NeuralPDE?](https://discourse.julialang.org/t/define-geometry-for-neuralpde/100921)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 6\
**Last updated:** [June 29, 2023, 3:50pm UTC](https://discourse.julialang.org/t/define-geometry-for-neuralpde/100921 "2023-06-29T15:50:13Z")

</div>

Hi, I’m looking into solving PDEs on a 2d domain using PINNs and would like to try the NeuralPDE package. Is there a way to define a custom geometry besides linear intervals? I can’t find it in the documentation, the e…

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

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