# \#lux

**URL:** https://discourse.julialang.org/tag/lux/1216.md

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

---

## [\[ANN\] ReactantNitro.jl: Reactant-first training framework](https://discourse.julialang.org/t/ann-reactantnitro-jl-reactant-first-training-framework/139500)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 4\
**Last updated:** [September 22, 2026, 7:47am UTC](https://discourse.julialang.org/t/ann-reactantnitro-jl-reactant-first-training-framework/139500 "2026-09-22T07:47:15Z")

</div>

I’m excited to finally release ReactantNitro.jl; a Reactant-first training framework inspired by PyTorch Lightning, but specifically designed around making working with Reactant.jl easy while still allowing for a large a…

---

## [Post-doc position at the GHER, ULiège, Belgium](https://discourse.julialang.org/t/post-doc-position-at-the-gher-uliege-belgium/139159)

<div class="topic-metadata">

**Author:** [@Alexander-Barth](https://discourse.julialang.org/u/Alexander-Barth)\
**Replies:** 0\
**Last updated:** [September 2, 2026, 8:38am UTC](https://discourse.julialang.org/t/post-doc-position-at-the-gher-uliege-belgium/139159 "2026-09-02T08:38:24Z")

</div>

We invite applications for a project scientist (post-doc) position at the GeoHydrodynamics and Environment Research group (GHER, https://www.gher.uliege.be) of the University of Liège in Belgium. The candidate will work …

---

## [\[ANN\] Luximm.jl: Lux ports of timm image backbones, with HuggingFace pretrained weights](https://discourse.julialang.org/t/ann-luximm-jl-lux-ports-of-timm-image-backbones-with-huggingface-pretrained-weights/137153)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 13\
**Last updated:** [August 14, 2026, 12:27am UTC](https://discourse.julialang.org/t/ann-luximm-jl-lux-ports-of-timm-image-backbones-with-huggingface-pretrained-weights/137153 "2026-08-14T00:27:32Z")

</div>

I’m happy to share a first public look at Luximm.jl, a Julia package that ports image-classification backbones from Ross Wightman’s timm (PyTorch Image Models) to Lux.jl. Pretrained weights load directly from the Hugging…

---

## [\[WIP\] ONNXExport.jl - Export Julia functions to ONNX](https://discourse.julialang.org/t/wip-onnxexport-jl-export-julia-functions-to-onnx/138588)

<div class="topic-metadata">

**Author:** [@martinkjlarsson](https://discourse.julialang.org/u/martinkjlarsson)\
**Replies:** 0\
**Last updated:** [August 4, 2026, 7:14am UTC](https://discourse.julialang.org/t/wip-onnxexport-jl-export-julia-functions-to-onnx/138588 "2026-08-04T07:14:27Z")

</div>

Hello, What ONNXExport.jl is a package for exporting Julia functions as ONNX models. It is still an unregistered WIP but has a decent coverage of Julia, NNlib, MLUtils, and Lux functions. See the README for detailed cov…

---

## [Invertible Neural Networks](https://discourse.julialang.org/t/invertible-neural-networks/137909)

<div class="topic-metadata">

**Author:** [@langestefan](https://discourse.julialang.org/u/langestefan)\
**Replies:** 0\
**Last updated:** [July 2, 2026, 2:40pm UTC](https://discourse.julialang.org/t/invertible-neural-networks/137909 "2026-07-02T14:40:20Z")

</div>

I was looking at doing some modelling work using invertible neural-networks in Julia with Lux.jl. There aren’t many options, but I found GitHub - slimgroup/InvertibleNetworks.jl: A Julia framework for invertible neural …

---

## [Lux & Reactant on Colab TPUs](https://discourse.julialang.org/t/lux-reactant-on-colab-tpus/126926)

<div class="topic-metadata">

**Author:** [@avikpal](https://discourse.julialang.org/u/avikpal)\
**Replies:** 5\
**Last updated:** [May 21, 2026, 5:30pm UTC](https://discourse.julialang.org/t/lux-reactant-on-colab-tpus/126926 "2026-05-21T17:30:22Z")

</div>

Colab now has Lux and Reactant pre-installed. Here’s a starter script for TPUs (change the runtime, and it will automatically work on CPU or GPU)

---

## [Error and Segfault with DeviceIterator for parallel DataLoader on sharded ReactantDevice](https://discourse.julialang.org/t/error-and-segfault-with-deviceiterator-for-parallel-dataloader-on-sharded-reactantdevice/137074)

<div class="topic-metadata">

**Author:** [@benjwweber](https://discourse.julialang.org/u/benjwweber)\
**Replies:** 1\
**Last updated:** [May 14, 2026, 10:28pm UTC](https://discourse.julialang.org/t/error-and-segfault-with-deviceiterator-for-parallel-dataloader-on-sharded-reactantdevice/137074 "2026-05-14T22:28:16Z")

</div>

I am trying to load a data set via a DataLoader/DeviceIterator to a sharded ReactantDevice. I have replicated it here with a mock data set. However I run into a variety of errors or segfaults if I do this. Is there anyth…

---

## [Pathological compile times training a Lux+CUDA descriptor CNN with a similarity-matrix (SupCon) loss — Reactant, Zygote, and manual loops all hang on first step](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 2\
**Last updated:** [April 26, 2026, 11:49am UTC](https://discourse.julialang.org/t/pathological-compile-times-training-a-lux-cuda-descriptor-cnn-with-a-similarity-matrix-supcon-loss-reactant-zygote-and-manual-loops-all-hang-on-first-step/136884 "2026-04-26T11:49:43Z")

</div>

\--- Body: I’ve been trying to train a small descriptor CNN (~1M params, 64×64 grayscale patch input → 128-dim L2-normalized embedding) with a Supervised Contrastive (SupCon) loss in pure Julia / Lux on a single B200…

---

## [Passing whole sequence to next layer from RNNCell in Lux](https://discourse.julialang.org/t/passing-whole-sequence-to-next-layer-from-rnncell-in-lux/136779)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 0\
**Last updated:** [April 19, 2026, 4:42pm UTC](https://discourse.julialang.org/t/passing-whole-sequence-to-next-layer-from-rnncell-in-lux/136779 "2026-04-19T16:42:39Z")

</div>

Hello, I am trying to reproduce some basic code for training recurrent spiking networks. Here you can find an old porting for Flux from spytorch. I already adapted to the current Flux version, but I would really like t…

---

## [Reactant.jl + Enzyme: ~10 min compilation overhead triggered by hidden-to-hidden Dense layers](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374)

<div class="topic-metadata">

**Author:** [@Yuan-Ru-Lin](https://discourse.julialang.org/u/Yuan-Ru-Lin)\
**Replies:** 1\
**Last updated:** [March 27, 2026, 11:22am UTC](https://discourse.julialang.org/t/reactant-jl-enzyme-10-min-compilation-overhead-triggered-by-hidden-to-hidden-dense-layers/136374 "2026-03-27T11:22:11Z")

</div>

I’ve been investigating compilation times with Reactant.jl + Lux + AutoEnzyme() on an NVIDIA GPU and found a reproducible jump in TTFT (Time-To-First-Training) when a model includes hidden-to-hidden Dense layers. Minima…

---

## [Optimizing Lux.jl and Reactant.jl performance](https://discourse.julialang.org/t/optimizing-lux-jl-and-reactant-jl-performance/135942)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 3\
**Last updated:** [March 6, 2026, 8:58pm UTC](https://discourse.julialang.org/t/optimizing-lux-jl-and-reactant-jl-performance/135942 "2026-03-06T20:58:07Z")

</div>

I am facing two separate issues. One is related to setting Reactant initialization options to improve performance and the other is about avoiding unnecessary latencies in neural network training loop via compilation. No…

---

## [Slow Reactant compilation for modified DeepONet](https://discourse.julialang.org/t/slow-reactant-compilation-for-modified-deeponet/135133)

<div class="topic-metadata">

**Author:** [@Jan\_Strube](https://discourse.julialang.org/u/Jan_Strube)\
**Replies:** 9\
**Last updated:** [January 23, 2026, 8:55pm UTC](https://discourse.julialang.org/t/slow-reactant-compilation-for-modified-deeponet/135133 "2026-01-23T20:55:23Z")

</div>

I’m trying to implement the modified Deep Operator Network from this paper: Improved architectures and training algorithms for deep operator networks" (arXiv:2110.01654). The addition over the vanilla DeepONet is a set …

---

## [NODE Training - Performance w/ Lux vs torchdiffeq](https://discourse.julialang.org/t/node-training-performance-w-lux-vs-torchdiffeq/134860)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 6\
**Last updated:** [January 5, 2026, 7:13pm UTC](https://discourse.julialang.org/t/node-training-performance-w-lux-vs-torchdiffeq/134860 "2026-01-05T19:13:34Z")

</div>

So I’ve been training a neural ODE in Python using PyTorch and torchdiffeq. I was going to start with Julia and Lux but I ended up needing to train some upstream stuff (pretrained CNN backbones and custom PyTorch layers)…

---

## [High memory usage when training a custom Lux model](https://discourse.julialang.org/t/high-memory-usage-when-training-a-custom-lux-model/134714)

<div class="topic-metadata">

**Author:** [@HMegh](https://discourse.julialang.org/u/HMegh)\
**Replies:** 8\
**Last updated:** [December 26, 2025, 1:22am UTC](https://discourse.julialang.org/t/high-memory-usage-when-training-a-custom-lux-model/134714 "2025-12-26T01:22:11Z")

</div>

I am trying to implement a custom Lux model, but I keep running out of memory even with small number (~500) of parameters. I have two kinds of layers (called sympnets) which take in and return two vectors. Each layer upd…

---

## [Matrix multiplication fails with Reactant and Lux](https://discourse.julialang.org/t/matrix-multiplication-fails-with-reactant-and-lux/134612)

<div class="topic-metadata">

**Author:** [@weltenbummler](https://discourse.julialang.org/u/weltenbummler)\
**Replies:** 2\
**Last updated:** [December 17, 2025, 4:34pm UTC](https://discourse.julialang.org/t/matrix-multiplication-fails-with-reactant-and-lux/134612 "2025-12-17T16:34:06Z")

</div>

Hello, I have this simple script: using LinearAlgebra using Reactant using Lux dev = reactant\_device() #dev = cpu\_device() A = dev(rand(Float32, 2, 2)) B = dev(rand(Float32, 2, 3)) A \* B # ERROR: conversion to point…

---

## [Very slow training of Neural ODE with exogeneous input compared to jax using dense interpolated solution](https://discourse.julialang.org/t/very-slow-training-of-neural-ode-with-exogeneous-input-compared-to-jax-using-dense-interpolated-solution/134557)

<div class="topic-metadata">

**Author:** [@johtok](https://discourse.julialang.org/u/johtok)\
**Replies:** 4\
**Last updated:** [December 15, 2025, 11:09pm UTC](https://discourse.julialang.org/t/very-slow-training-of-neural-ode-with-exogeneous-input-compared-to-jax-using-dense-interpolated-solution/134557 "2025-12-15T23:09:39Z")

</div>

Hi guys! Ive been breaking my neck trying to get a julia alternative to this jax neural ode with exogeneous input script working but without luck! The julia version is painfully slow whereas the jax version runs in a c…

---

## [Learning a mapping from an image to an ODE](https://discourse.julialang.org/t/learning-a-mapping-from-an-image-to-an-ode/134456)

<div class="topic-metadata">

**Author:** [@csvance](https://discourse.julialang.org/u/csvance)\
**Replies:** 4\
**Last updated:** [December 10, 2025, 6:00pm UTC](https://discourse.julialang.org/t/learning-a-mapping-from-an-image-to-an-ode/134456 "2025-12-10T18:00:06Z")

</div>

I have trained a CNN to map an image to a sequence of feature vectors f\_v and I want to learn a function du(u, f\_v) that maps the feature vectors to an ODE. For each image I know how to compute both the function and firs…

---

## [Using Neural ODEs to learn a family of ODEs (with Automatic Differentiation)](https://discourse.julialang.org/t/using-neural-odes-to-learn-a-family-of-odes-with-automatic-differentiation/134348)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 13\
**Last updated:** [December 9, 2025, 1:59am UTC](https://discourse.julialang.org/t/using-neural-odes-to-learn-a-family-of-odes-with-automatic-differentiation/134348 "2025-12-09T01:59:34Z")

</div>

I am running into issues when trying to use reverse-mode automatic differentiation via Zygote when trying to solve families of Given u(t), we can train a neural ODE to find the underlying ODE du/dt = f(u, t). For examp…

---

## [How to correctly use Lux and Training API with reactant?](https://discourse.julialang.org/t/how-to-correctly-use-lux-and-training-api-with-reactant/133799)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 3\
**Last updated:** [November 12, 2025, 6:04pm UTC](https://discourse.julialang.org/t/how-to-correctly-use-lux-and-training-api-with-reactant/133799 "2025-11-12T18:04:09Z")

</div>

Hi, I’m trying to train neural networks with Lux, Reactant, and the Training API and am confused about how to tie it together. When I’m compiling a model with reactant, should I still use the TrainState API? I tried …

---

## [Lux/Enzyme error when Training my model?](https://discourse.julialang.org/t/lux-enzyme-error-when-training-my-model/133442)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 9\
**Last updated:** [November 2, 2025, 1:44am UTC](https://discourse.julialang.org/t/lux-enzyme-error-when-training-my-model/133442 "2025-11-02T01:44:19Z")

</div>

Hi, I’m trying to get a simple language model to train using Lux/Enzyme and get a big scary error. Does anyone have insight into how to get to the bottom of this? Is there an error in the MWE? I tried Zygote and it run…

---

## [Problems when replacing Flux by Lux in anodes example](https://discourse.julialang.org/t/problems-when-replacing-flux-by-lux-in-anodes-example/133120)

<div class="topic-metadata">

**Author:** [@Jaime\_Araneda](https://discourse.julialang.org/u/Jaime_Araneda)\
**Replies:** 1\
**Last updated:** [October 24, 2025, 1:19pm UTC](https://discourse.julialang.org/t/problems-when-replacing-flux-by-lux-in-anodes-example/133120 "2025-10-24T13:19:21Z")

</div>

Hello, I’m trying to reproduce the anodes example on augmented neural ODEs from the thread Fitting neural ODE to periodic time series. However, when replacing Flux by the Lux library (with the corresponding changes) I g…

---

## [How to ignore minibatches with NaN gradients optimizing a hybrid LUX model using Optimization.jl](https://discourse.julialang.org/t/how-to-ignore-minibatches-with-nan-gradients-optimizing-a-hybrid-lux-model-using-optimization-jl/132615)

<div class="topic-metadata">

**Author:** [@progtw1](https://discourse.julialang.org/u/progtw1)\
**Replies:** 1\
**Last updated:** [October 24, 2025, 1:17pm UTC](https://discourse.julialang.org/t/how-to-ignore-minibatches-with-nan-gradients-optimizing-a-hybrid-lux-model-using-optimization-jl/132615 "2025-10-24T13:17:45Z")

</div>

I try following the LUX tutorial on fitting an ML model using Optimization.jl for fitting a hybrid model, where the LUX model predicts some parameters of a process-based model, the LUX model application is just a call in…

---

## [Reactant.jl and Lux.jl don't work with Adam optimiser](https://discourse.julialang.org/t/reactant-jl-and-lux-jl-dont-work-with-adam-optimiser/132278)

<div class="topic-metadata">

**Author:** [@flick](https://discourse.julialang.org/u/flick)\
**Replies:** 9\
**Last updated:** [September 30, 2025, 10:54pm UTC](https://discourse.julialang.org/t/reactant-jl-and-lux-jl-dont-work-with-adam-optimiser/132278 "2025-09-30T22:54:14Z")

</div>

I am writing a training program for the VAEAC model, but when I use Optimisers.Adam(lr), I get an error. When I use, for example, Optimisers.Descent(lr), this problem does not occur. Error message: ERROR: MethodError: …

---

## [Understanding the Lux.jl + ReverseDiff TrackedArray Warning in UDEs](https://discourse.julialang.org/t/understanding-the-lux-jl-reversediff-trackedarray-warning-in-udes/132488)

<div class="topic-metadata">

**Author:** [@guscaldas](https://discourse.julialang.org/u/guscaldas)\
**Replies:** 2\
**Last updated:** [September 22, 2025, 1:47pm UTC](https://discourse.julialang.org/t/understanding-the-lux-jl-reversediff-trackedarray-warning-in-udes/132488 "2025-09-22T13:47:43Z")

</div>

Hello everyone, I’m working with Universal Differential Equations (UDEs) using Lux.jl and Optimization.jl, and I consistently encounter the following warning when the training process begins. This also happens when runn…

---

## [Using Reactant with Lux and Enzyme to speed up training in physics context](https://discourse.julialang.org/t/using-reactant-with-lux-and-enzyme-to-speed-up-training-in-physics-context/131898)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 16\
**Last updated:** [August 28, 2025, 8:56pm UTC](https://discourse.julialang.org/t/using-reactant-with-lux-and-enzyme-to-speed-up-training-in-physics-context/131898 "2025-08-28T20:56:28Z")

</div>

I am training a neural network in a physical context on observables; crucially, the network is producing values which are passed through some physics calculations before being compared to the training data. My code works…

---

## [Lux + Enzyme naively applying model seems to cause runtime activity error](https://discourse.julialang.org/t/lux-enzyme-naively-applying-model-seems-to-cause-runtime-activity-error/131531)

<div class="topic-metadata">

**Author:** [@r0uv3n](https://discourse.julialang.org/u/r0uv3n)\
**Replies:** 23\
**Last updated:** [August 25, 2025, 10:56am UTC](https://discourse.julialang.org/t/lux-enzyme-naively-applying-model-seems-to-cause-runtime-activity-error/131531 "2025-08-25T10:56:54Z")

</div>

Consider the simple setup using Lux, LinearAlgebra import Optimization, Random, Enzyme, ComponentArrays model = Chain( Dense(2 =\> 16, Lux.tanh), Dense(16, 1), ) parameters, states = Lux.setup(Random.Xoshiro(42…

---

## [I heard lux.jl is moving to reactant.jl. Where can I help?](https://discourse.julialang.org/t/i-heard-lux-jl-is-moving-to-reactant-jl-where-can-i-help/131625)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 4\
**Last updated:** [August 15, 2025, 8:43am UTC](https://discourse.julialang.org/t/i-heard-lux-jl-is-moving-to-reactant-jl-where-can-i-help/131625 "2025-08-15T08:43:05Z")

</div>

I heard lux.jl is moving to reactant.jl. Personally, that’s a really good news. Not only would it probably be something actionable for me (like implementing machine learning layers), it could also help me get closer to r…

---

## [Lux flexible architecture initialization plus setting parameters to Float64](https://discourse.julialang.org/t/lux-flexible-architecture-initialization-plus-setting-parameters-to-float64/131530)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 2\
**Last updated:** [August 11, 2025, 7:03pm UTC](https://discourse.julialang.org/t/lux-flexible-architecture-initialization-plus-setting-parameters-to-float64/131530 "2025-08-11T19:03:33Z")

</div>

I’m switching to Lux for my ML problems, and I need advice on a couple basic things. How can I initialize my network in a flexible way so that the number of layers and nodes is an argument? How can I force the network …

---

## [Reactant + Lux LLama on TPUs](https://discourse.julialang.org/t/reactant-lux-llama-on-tpus/131492)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 0\
**Last updated:** [August 9, 2025, 3:03pm UTC](https://discourse.julialang.org/t/reactant-lux-llama-on-tpus/131492 "2025-08-09T15:03:53Z")

</div>

Just wanted to share how to use Reactant+Lux on TPUs for a LLama like transformer model, it seems really nice to write even though its hard to adapt to the compact way of writting it does feel a lot better after. Still c…

---

## [Loading Lux params and states in a new script](https://discourse.julialang.org/t/loading-lux-params-and-states-in-a-new-script/131370)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 1\
**Last updated:** [August 5, 2025, 11:49am UTC](https://discourse.julialang.org/t/loading-lux-params-and-states-in-a-new-script/131370 "2025-08-05T11:49:29Z")

</div>

To save a model the Training a Simple Lstm tutorial shows the following using JDL2 package # train.jl using JLD2 @save "trained\_model.jld2" ps\_trained st\_trained @load "trained\_model.jld2" ps\_trained st\_trained But th…

[Next page](https://discourse.julialang.org/tag/lux/1216.md?match_all_tags=true&page=1&tags%5B%5D=lux)
